[Setup] Apache sites with Zope sites

Ricardo Newbery ric at digitalmarbles.com
Tue Mar 17 19:15:22 UTC 2009


On Mar 17, 2009, at 7:01 AM, Christopher Boomer wrote:
>> A typical error, which makes no sense to me, but which clearly  
>> indicates I have not understood the apache directives correctly is:
>
> [Tue Mar 17 13:01:54 2009] [warn] VirtualHost www.abc.tld:80  
> overlaps with VirtualHost www.xyz.tld:80, the first has precedence,  
> perhaps you need a NameVirtualHost directive


The VirtualHost argument much match the NameVirtualHost argument.  You  
can have multiple NameVirtualHost directives if you want to support  
multiple ports and Also, dump the RewriteCond inside the VirtualHost.   
Also, rewrite directives aren't inherited by virtual hosts, so you  
need to turn on the rewrite engine explicitly in each.

Try something like so:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.example.tld
DocumentRoot /home/user/example
</VirtualHost>

<VirtualHost *:80>
ServerName www.abc.tld
RewriteEngine On
RewriteRule ^/(.*) \
   http://localhost:8080/VirtualHostBase/http/%{SERVER_NAME}:80/ 
abcplonesite/VirtualHostRoot/$1 [L,P]
</VirtualHost>


Caveat, I don't usually use the wildcard semantics so I might be  
missing something.  You can also try the above with all the "*:80"  
changed to "<ip address>:80".



> I've tried ServerAlias in place of server name (http://plone.org/documentation/tutorial/plone-apache/virtualhost 
> ).
> I've tried <VirtualHost *:80> in one and more blocks.
> I've tried the virtualhost sections without the RewriteCond  
> statements.
> The clue is definitely that nothing appears in my rewrite logs when  
> the VirtualHost sections are in place.


I'm guessing you missed the RewriteEngine issue in your experiments.

Ric







More information about the Setup mailing list