Jonathan Mast wrote:
OK, so I added NameVirtualHost foo.mysite.com:80 <http://foo.mysite.com:80> and NameVirtualHost foo.mysite.com:443 <http://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 <http://mysite.com>, othersite.com <http://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?
Sounds like there may be some confusion on the best way to set this up. Assuming your IP address is 1.2.3.4, you should set it up as follows:
------------------------------ NameVirtualHost 1.2.3.4:80 <VirtualHost 1.2.3.4:80> ServerName blah.mysite.com ... </VirtualHost> <VirtualHost 1.2.3.4:80> ServerName foo.mysite.com ... </VirtualHost> <VirtualHost 1.2.3.4:443> ServerName foo.mysite.com ... SSL stuff </VirtualHost> <VirtualHost 1.2.3.4:80> ServerName bar.othersite.com ... </VirtualHost> ------------------------------If your IP address changes, you can substitute * from the IP address in all locations for port 80. I've had trouble myself using *:443 for SSL, so it may not be supported. As pointed out, using the hostname in the NameVirtualHost and <VirtualHost> directives is not recommended (DNS lookups).
-- Justin Pasher --------------------------------------------------------------------- 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@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx