Re: About: NameVirtualHost ... has no VirtualHosts

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

 



On Sun, Apr 5, 2009 at 6:18 PM, J. Greenlees <lists@xxxxxxxxxxxxxxxxxxx> wrote:


> I tried specifying the name in the NameVirtualHost for 3 domains.
> [ one entry per domain, naturally. ] It was only by using the *.:80 in
> the NameVirtualHost directive, and only having the one NameVirtualHost
> for multiple vhosts that the error went away.

You could have found this out by reading the manual too :-)

It is _by design_ that name based virtual hosts works this way.
The "NameVirtualHost" directive tells the apache daemon on what IP
address/port combination it should handle requests for multiple, named
based virtual hosts. The most usual way this is used is by specifying

NameVirtualHost *:80.

You do not normally use names here, unless you have several IP
adresses associated with your machine, and want to distinguish between
them using a name, and not an IP.
When a request arrives on a IP/port combination mentioned in a
NameVirtualHost directive the server will next look at <VirtualHost>
blocks that match the NameVirtualHost directive. And the first block
where the "Servname" directive matches the "host" header in the HTTP
request will be used. If none match the first <VirtualHost> will be
used.
You normally would have <VirtualHost> blocks that look like this:

<VirtualHost *:80>
Servername foo.com

</VirtualHost>

Putting the servhostname in the <VirtualHost> tag itself does not
cause apache to match requests to this hostname to this block, as in
the value inside the <VirtualHost> tag is only used to match against a
NameVirtualHost statement...

Krist

-- 
krist.vanbesien@xxxxxxxxx
krist@xxxxxxxxxxxxx
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

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