httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Evans <tevans...@googlemail.com>
Subject Re: [users@httpd] Mangled my Virtual Hosts
Date Thu, 26 Mar 2009 17:25:26 GMT
On Thu, 2009-03-26 at 09:28 -0500, Joseph Morgan wrote:
> I tried just the *:80... but that didn't work at all... no web sites 
> worked after that...

You should have these directives in your conf file:

Listen 80
NameVirtualHost *

<VirtualHost *>
  ServerName www.prosportsresumes.com
  # all other directives for this vhost
</VirtualHost

<VirtualHost *>
  ServerName www.videofortworth.com
  # all the other directives for this vhost
</VirtualHost>

'Listen 80' says to listen on port 80, all interfaces.
'NameVirtualHost *' says to look for virtual hosts when the request is
received on a socket which matches * (ie, all requests)
'<VirtualHost *>' says that this is a vhost that can match when we match
the corresponding NameVirtualHost.

Configure different access and error logs for each vhost, this should
explain which vhost you are hitting.

Your DNS settings have nothing to do with apache, apache does not care
about DNS a great deal. It would help with connecting to those vhosts
from the local machine though. 

Apache simply looks at the socket the request is received on, looks at
the host header of the request, and finds a vhost that matches the
receiving socket and the host header. If it cant find one that matches
them both, it serves the first mentioned vhost that matches the socket.

Cheers

Tom


---------------------------------------------------------------------
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