httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark McCulligh <mmccu...@visualtech.ca>
Subject Re: [users@httpd] NameVirtualHost Defaults
Date Thu, 30 Sep 2004 21:38:19 GMT
Thomas C. Meggs wrote:

>On Thu, Sep 30, 2004 at 05:00:59PM -0400, Mark McCulligh wrote:
>  
>
>>You are right in your assumption. If you have vhost using the same IP 
>>address and someone ask for a domain name that is not found to have its 
>>own vhost record it will load the first vhsot record with that IP address.
>>
>>I would use |ServerAlias:
>>|
>>
>><VirtualHost *:80>
>>ServerName c.site.com
>>ServerAlias d.site.com
>>[... snip ...]
>></VirtualHost>
>>
>>I wouldn't do the _default_ method personally.  Using ServerAlias will 
>>keep you vhost record easy to read and know what will link to what. Just 
>>my two cents.
>>    
>>
>
>Hi Mark,
>
>Thanks for your response.
>
>In my case, I would really like there to be a default site that
>answers to any request not covered by a VirtualHost directive.
>
>Idealy that site would not be the first alphabetical hostname,
>but rather one that I specify. I would like to do this for both
>ports 80 and 443 under one instance of apache2.
>
>Are you familiar with any way to accomplish this? I was under the
>assumption that using <VirtualHost _default_> would accomplish
>this, but it doesn't seem to be the case.
>
>Tom
>  
>
 From my understanding of the _default_ it will caught unmatched IP 
addresses

Example:

<VirtualHost 192.168.0.100:80>
ServerName a.site.com
[... snip ...]
</VirtualHost>

<VirtualHost 192.168.0.100:80>
ServerName b.site.com
[... snip ...]
</VirtualHost>

<VirtualHost _default_:80>
[... snip ...]
</VirtualHost>

If the domain name with IP address 192.168.0.101 came into the server it will use the _default_
vhost.

But if c.site.com with IP address 192.168.0.100 came in it would use the 
first vhost with IP address 192.168.0.100. Which is a.site.com

I am not 100% sure this is how it work as I have not tested this out. 
But I think this is what happens.

Mark.


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