[mod_python] Connection Handler in a virtual host

Kamil Niechajewicz kamil at nvstudio.pl
Mon Mar 1 18:13:56 EST 2004

On Mon, 1 Mar 2004 16:31:46 +0200 (EET)
Miikka Miettinen <mmmietti at cs.helsinki.fi> wrote:

> If I try this (supplemented with "NameVirtualHost site1.xyz.org:80" and 
> "NameVirtualHost site2.xyz.org:80"), I get the warning "NameVirtualHost 
> site2.xyz.org:80 has no VirtualHosts". Again, both sites work and have 
> different document roots, but the connection handler still isn't called.
> If I understood the Apache documentation correctly, you normally use the 
> server's IP address in the NameVirtualHost directive. I only have one IP 
> address, so maybe I get the warning because both virtual hosts somehow 
> look the same. But the document roots are different. Confusing.

I will give you example for my site, for example somewhere I have IP which serves two virtual hosts xyz.org and abc.com

You need only one NameVirtualHost because you just want to tell Apache
what IPs serve virtual hosts. When your hosts have IN A for the same IP 
just put it in NameVirtualHost, and then define those hosts in VirtualHost


<VirtualHost xyz.org:80>

<VirtualHost abc.com:80>

   # this will be applied when user views instead
   # of http://abc.com or http://xyz.org

and it works without problem and always worked.


More information about the Mod_python mailing list