RE: NameVirtualHost Directive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



NameVirtualHost is used only if you want to host several web sites using the same IP/port combination as opposed to IP-based virtual hosting where exactly one site (server name) is hosted on each IP/port combination.

If you use Name-based virtual hosting, you may provide several VirtualHost sections for the IP/port combination declared as NameVirtualHost. In that case Apache will compare the Host-header of the request with the ServerName of the name-based virtual hosts. If one matches, the request will be processed in the context of that virtual host. If none match, the context of the first virtual host declared for that IP/port will be used.

You can very well mix name-based and IP-based virtual hosting in the same Apache server.

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

-ascs
________________________________

De : Bryan Richardson [mailto:btricha@xxxxxxxxx] 
Envoyé : lundi 17 décembre 2007 04:44
À : users@xxxxxxxxxxxxxxxx
Objet :  NameVirtualHost Directive


Hello all,

I'm curious as to why one would ever need to use the NameVirtualHost directive in site configuration files.  I just can't seem to get my head around why it's *sometimes* required.  I say sometimes only because I've seen instances where it isn't used at all.  If all VirtualHost arguments *must* match the IP address given with the NameVirtualHost directive, then what's the point? 

I learn best by example... can anyone give me an example of when it is needed?

Thanks! -- BTR


---------------------------------------------------------------------
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



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux