httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: VirtualHosts and ServerName/Alias
Date Mon, 12 Aug 2002 02:18:57 GMT
Kees Hoekzema wrote:

> So no "ServerName *.tweakers.net" here, instead of it a "ServerAlias
> *.tweakers.net"
> This is because i'm loadbalancing my site over up to 6 webservers, and i
> want the name of that server to show up in the 40x, 50x and /server-status
> pages. (so it says "realservername.tweakers.net" instead of
> "virtualhostservername.tweakers.net").

Use:
UseCanonicalName off
to get this to work.  But you should also have a ServerName in there, 
just for completeness if nothing else.

> 
> Second, when I have an configuration like:
> 
> ServerName test.tweakers.net
> DocumentRoot /www/htdocs
> # vhost1
> <VirtualHost *>
>     DocumentRoot /www/htdocs/tweakers.www
>     ServerAlias www.tweakers.net
> </VirtualHost>
> # vhost 2
> <VirtualHost *>
>     DocumentRoot /www/htdocs/tweakers
>     ServerAlias *.tweakers.net
> </VirtualHost>
> 
> and a request for test.tweakers.net comes in, wich docroot will get used?
> three posibilities ofcourse: /www/htdocs, /www/htdocs/tweakers or
> /www/htdocs/tweakers.www. And why?

/www/htdocs/tweakers

Assuming you have "NameVirtualHost *", the /www/htdocs documentroot will 
NEVER get used.  *.tweakers.net matches test.tweakers.net, so that vhost 
will be used. The exact matching algorithm is described in 
http://httpd.apache.org/docs-2.0/vhosts/name-based.html in the paragraph 
that starts "Now when a request arrives ...".

Joshua.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message