On Fri, Dec 18, 2009 at 12:06 PM, Jonathan Mast
<[email protected]> wrote:
> Frank, I've always used the ServerName directive, here's what my configs
> look like:
> NameVirtualHost foo.mysite.com:80
> <VirtualHost foo.mysite.com:80>
>     ServerName   foo.mysite.com
>
> </VirtualHost>
>
> NameVirtualHost foo.mysite.com:443
> <VirtualHost foo.mysite.com:443>
>     ServerName   foo.mysite.com
>
>     SSL Stuff...
> </VirtualHost>
>
> My question was specifically why putting the hostname as opposed to the addr
> in the NameVirtualHost was discouraged in the docs (they don't explain it
> any further)?

It's just unnecessarily confusing, because anyone looking at yout
config needs to know what set of addresses that resolved to when you
started your webserver.   It's also going to mysteriously send
requests to the base server config, or other vhosts, when you get a
request for that hostname that arrive on a different interface.

Most people who a) have vhost trouble and b) put hostnames as the
first parm in VirtualHost are misunderstanding name-based virtualhosts
configuration.  Most of them don't even need to discriminate between
IP addresses at all, and should just have *:port.

-- 
Eric Covener
[email protected]

---------------------------------------------------------------------
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: [email protected]
   "   from the digest: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to