[Zope] virtualhost/apache2 problem

S.Hayles sh23 at leicester.ac.uk
Thu Feb 2 03:39:33 EST 2006


Hi Zenobito

In your Apache config you have 2 virtual hosts both trying to catch 
everything. To have ZOPE appear at /zope within your normal site, you need 
a single virtual host, and embed the rewrite rule in it. Something like:

RewriteRule ^/zope/(.*) http://127.0.0.1:8888/VirtualHostBase/http/www.mysite.com/zope:80/comune/VirtualHostRoot/_vh_zopesite/$1  [L,P]

Steven

Steven Hayles - Computer Systems Developer, sh23 at le.ac.uk
Learning Technology Section, Computer Centre, 
University of Leicester, University Rd, Leicester, LE1 7RH 
Fax (0/+44)116 2525027 WWW <URL:http://www.le.ac.uk/home/sh23>

On Thu, 2 Feb 2006, zenobito zenobito wrote:

> Hello,
> I'm trying to set up apache2 to serve two sites, a "normal" one on
> www.mysite.com and a zope one on www.mysite.com/zope (using rewrite rules).
> I already know how to put apache2 in front of zope, but in this situation
> something doesn't work: I read every howto's but when connecting to
> http://www.mysite.com/zope I get a 404 error from apache2: it seems like
> mysite.com comes first, so if there is no "zope" folder (actually it doesn't
> exist), it gets an error.
> I hope someone can help me.
> This is my apache2 configuration file.
>
> Bye,
> zenobito
>
> Apache2 conf:
>
> ---------------------------
> NameVirtualHost *
> <VirtualHost *>
>    ServerAdmin webmaster at localhost
>
>    DocumentRoot /var/www/www-docs
>    ServerName www.mysite.com
>
>        <Directory />
>        Options FollowSymLinks
>        AllowOverride None
>    </Directory>
>    <Directory /var/www/>
>        Options Indexes FollowSymLinks MultiViews
>        AllowOverride None
>        Order allow,deny
>        allow from all
>        # This directive allows us to have apache2's default start page
>                # in /apache2-default/, but still have / go to the right
> place
>                # Commented out for Ubuntu
>                #RedirectMatch ^/$ /apache2-default/
>    </Directory>
>
>    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
>    <Directory "/usr/lib/cgi-bin">
>        AllowOverride None
>        Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
>        Order allow,deny
>        Allow from all
>    </Directory>
>
>    ErrorLog /var/log/apache2/error.log
>
>    # Possible values include: debug, info, notice, warn, error, crit,
>    # alert, emerg.
>    LogLevel warn
>
>    CustomLog /var/log/apache2/access.log combined
>    ServerSignature On
>
>    Alias /doc/ "/usr/share/doc/"
>    <Directory "/usr/share/doc/">
>        Options Indexes MultiViews FollowSymLinks
>        AllowOverride None
>        Order deny,allow
>        Deny from all
>        Allow from 127.0.0.0/255.0.0.0 ::1/128
>    </Directory>
>
> </VirtualHost>
>
> <VirtualHost *>
>    RewriteEngine On
>    RewriteRule ^/(.*)
> http://127.0.0.1:8888/VirtualHostBase/http/www.mysite.com/zope:80/comune/VirtualHostRoot/_vh_zopesite/$1
> [L,P]<http://127.0.0.1:8888/VirtualHostBase/http/www.mysite.com/zope:80/comune/VirtualHostRoot/_vh_zopesite/$1[L,P]>
> <Directory />
>        Options FollowSymLinks
>        AllowOverride None
>    </Directory>
> </VirtualHost>
>


More information about the Zope mailing list