httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: [users@httpd] **Virtual hosts question**
Date Wed, 04 Jun 2003 00:34:07 GMT

On Tue, 3 Jun 2003, DuSTiN KRySaK wrote:
> My hostnames which work fine if I drop the first:
>
> <VirtualHost *>
>     DocumentRoot /var/www/html
> </VirtualHost>
>
>
> But I had added that because I wanted any http requests by IP, etc to come
> to the main site (host.domain.com). Now with that entry in there all site
> requests are going to the default site.....

This is actually a tricky one.  Luckily, I worked through this problem
with someone else before, so I know the answer:
Add
ServerName blah.blah.blah
to the first <VirtualHost> section (or "ServerName your.ip.address" if you
prefer).

If you don't have a servername, apache performs a reverse-lookup on your
IP address to find one.  This is probably giving it host.domain.com, which
causes the first vhost to catch all the requests.

This is a case where the dual-use of ServerName (vhost matching and
canonical identification) causes a bit of unnecessary confusion.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message