[vox-tech] apache2: NameVirtualHost and VirtualHost

Micah Cowan micah at cowan.name
Sat Nov 18 22:05:33 PST 2006


On Sun, 2006-11-19 at 00:31 -0500, Peter Jay Salzman wrote:
> Why is the NameVirtualHost directive necessary and how do I use it?

Although I've pretty much always used named virtual hosts, I've not
known about this command (or forgot it long ago). It appears to be set
up for named hosts by default in the .conf files I've used as templates.

According to the Apache docs, basically you need to use it to specify
which interfaces will have named virtual host support enabled. I think
the standard httpd.conf's tend to have the line:

  NameVirtualHost *:80

which says to activate named virtual hosts (and the use of your
<VirtualHost> sections for port 80 on all interfaces.

I imagine one might want to add *:443 for virtual hosts on the https
ports.

http://httpd.apache.org/docs/2.2/vhosts/name-based.html

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/



More information about the vox-tech mailing list