[Zope] I have tried everything!!! Isn't it possible to host several domains in 1 Zope and have apache running ????

Evan Simpson evan@4-am.com
Fri, 08 Jun 2001 15:11:43 -0400


Let's see if I understand your setup:

- Zope behind Apache
- Some content from Zope, some from Apache
- More than one domain

In this case, I recommend using Apache's mod_proxy and mod_rewrite 
modules together with Zope's VirtualHostMonster.  This requires the 
following steps:

1. Set up Apache so that it has mod_proxy and mod_rewrite enabled.

2. Set up Zope, and choose a port number for it to serve requests on. 
Port 8080 is the default, and will be used in the examples below.

3. Add a VirtualHostMonster to the root of your Zope.  Make up a unique 
name for it, and read the Add screen, but don't worry about it otherwise.

4. For each domain:

   4a. Create a Folder in your Zope root named after the domain (this 
name is used in step 4e).

   4b. Create a <VirtualHost> section in your Apache setup.

   4c. In this section, turn on rewriting and set up rewrite logging.

   4d. For each path that you want Apache to serve, add a rule that 
matches the path, leaves it unchanged, and stops rewriting.  It will 
look like this:

     RewriteRule /apache_content - [L]

   4e. Finally, add a rule that matches all remaining paths, rewrites 
them for the VirtualHostMonster, and sends them through mod_proxy.  It 
will look like this:

     RewriteRule ^/(.*) http://localhost:8080/VirtualHostBase/
       http/www.gitte.com:80/
       gitte.com/VirtualHostRoot/$1 [P,L]

*This is one line, not three, with no space between parts!*

That's all.  If your Zope isn't on the same machine as Apache, or isn't 
on port 8080, change the "localhost:8080".  If you name your Zope Folder 
"www.gitte.com" or "gitte", use that instead of "gitte.com".  If you 
make a <VirtualHost> for access through SSL, change the second part to 
"https/www.gitte.com:443/".

Cheers,

Evan @ digicool & 4-am