Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache2, Redhat9 Virtual Host Problem

Status
Not open for further replies.

JaeBrett

Programmer
May 5, 2003
196
0
0
CN
HELP! When I try to access either of these domains, , I get a Bad Request page. Why??
UseCanonicalName off
NameVirtualHost *


# Where do we put the lock and pif files?
LockFile "/var/lock/httpd.lock"
CoreDumpDirectory "/etc/httpd"

<VirtualHost *>
ServerAdmin jbrett@jaetech.ca
ServerName DocumentRoot /var/ <Directory &quot;/var/ Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *>
ServerAdmin cway@corywaydesign.com
ServerName DocumentRoot /var/ <Directory &quot;/var/ Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
 
I am temporarily hosting the sites off another computer so if you try to access them, it will work.

But when I point them to this IP, this is the page that comes up ....

--------------
Bad Request

Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

Hint:
Apache/2.0.40 Server at Port 80
---------------
 
Somehow or another you have apache listening on port 443 rather than port 80.
 
In httpd.conf, it says Listen *:80. Where would it be listening on port 443 ???
 
Now when I try to go to the pages, I get the Apache Test Page ... its like it doesnt pick up the ServerName ... any ideas on this? Heres what I changed.

UseCanonicalName off
NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin jbrett@jaetech.ca
ServerName DocumentRoot /var/</VirtualHost>
 
Do you have the directive [tt]SSLEngine On[/tt] outside a Virtual Host definition (one for port 443)?
 
SSLEngine isn't found anywhere in httpd.conf.

It seems SSL isn't my problem though now eh? It seems like it's not picking up the ServerName properly ...

Sooo confused.
 
If you try to access your web sites with an IP address instead of host name it will use the first virtual host listed. Also, if you use a hostname that doesn't match one of your virtual hosts it will again use the first virtual host.

It looks like it'd pick one of the virtual hosts you listed above, but you have other virtual hosts you may not know about. There's a line in your httpd.conf file,
Code:
Include conf.d/*.conf
, that brings in, among other things, ssl.conf. ssl.conf has a virtual host in it listening on port 443, which may be part of your problem. There also may or may not be other conf files included that have virtual hosts, so check that conf.d directory and see.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top