httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Mast <jhmast.develo...@gmail.com>
Subject Re: [users@httpd] Re: Enabling SSL on VirtualHosts Revisited
Date Fri, 18 Dec 2009 17:06:19 GMT
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)?


On Fri, Dec 18, 2009 at 11:41 AM, Frank Gingras
<francois.gingras@gmail.com>wrote:

> Jonathan Mast wrote:
>
>> OK, so I added NameVirtualHost foo.mysite.com:80 and NameVirtualHost
>> foo.mysite.com:443 above their respective sections and it seems to work
>> despite not being recommended as per the docs, but this was the only way
>> to
>> do it because all my domains: mysite.com, othersite.com, etc point to a
>> single IP.
>>
>> Any idea on why using hostnames in NameVirtualHost directives is not
>> recommended?  Is this something that could come back and bite me?
>>
>> Thanks for the help!
>>
>> On Fri, Dec 18, 2009 at 10:34 AM, Philip Wigg <phil@philipwigg.co.uk>
>> wrote:
>>
>>
>>
>>> Possibly the information you need is here:-
>>>
>>> http://httpd.apache.org/docs/2.2/vhosts/name-based.html
>>>
>>> When adding a name-based Virtual Host the...
>>>
>>> "Main host goes away
>>>
>>> If you are adding virtual hosts to an existing web server, you must
>>> also create a <VirtualHost> block for the existing host. The
>>> ServerName and DocumentRoot included in this virtual host should be
>>> the same as the global ServerName and DocumentRoot. List this virtual
>>> host first in the configuration file so that it will act as the
>>> default host."
>>>
>>> Cheers,
>>> Phil.
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>>
>>>
>>>
>>>
>>
>>
>>
> Jonathan,
>
> Using a hostname in the <VirtualHost> line will active DNS resolution for
> EVERY HTTP request. Surely, you don't want that to happen.
>
> Instead, use a ServerName in your virtual host.
>
> Frank.
>
>
> ---------------------------------------------------------------------
> 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