httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Shirley" <>
Subject using mod_vhost_alias with normal vhosts
Date Wed, 30 Aug 2006 11:20:09 GMT

(This concerns apache2.0, i've no idea if the other versions are affected too.)

I've discovered something that the vhosting docs don't seem to cover.
If you want to use both mod_vhost_alias (VirtualDocumentRoot et al)
and normal name-based vhosts (VirtualHost), you need to do something
like the following. For a server, with an ip address


    VirtualDocumentRoot /srv/%1/public_html

    DocumentRoot /var/www/

This is type of setup isn't covered in the vhost docs at all that i
can see. Where it gets tricky is the ServerName entry for the first
VirtualHost. Without it, here's what happens:, are served from
/var/www as expected is served from /srv/blah/public_html, also
as expected is served from /srv/host/public_html,
_not_ as expected.

Without a ServerName entry for the first VirtualHost, apache will
assign one from the reverse dns lookup for the ip, which points to Adding an explicit ServerName for a garbage hostname
works around this, giving the following:,, are served from /var/www as expected is served from /srv/blah/public_html, also
as expected

"You are technically correct, the best kind of correct."
- Bureaucrat 1.0, Futurama

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message