[Zope] Several domains and one Zope

Gilles Lenfant glenfant@bigfoot.com
Fri, 15 Jun 2001 14:13:29 +0200


Have Apache compiled with proxy and rewrite:
This is an excerpt of your future httpd.conf:
...
LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
...
LoadModule proxy_module /usr/lib/apache/1.3/libproxy.so
...
# Here the main IP address
NameVirtualHost 10.20.30.40

# Your first virtual host with its own log
<VirtualHost www.site_one.com>
   ServerName www.site_one.com
   RewriteEngine On
   RewriteRule ^/(.*) http://www.site_one.com:8080/$1 [P,l]
   CustomLog /var/log/apache/site_one_com.log common
</VirtualHost>
# Another one
<VirtualHost www.site_two.com>
   ServerName www.site_two.com
   RewriteEngine On
   RewriteRule ^/(.*) http://www.site_two.com:8080/$1 [P,l]
   CustomLog /var/log/apache/site_two_com.log common
</VirtualHost>
...
In addition, each site has got its own log (for debug, webalizer...)

Next, at your Zope root folder, add a "Set access rule" object with any id.
It's like a DTML method that contains (assumes that your two sites are
folders in the Zope root called "site_one" and "site_two"):

<dtml-if "_.string.split(_.string.lower(_.string.split(HTTP_HOST, ':')[0]),
'.')[-2:]==['site_one', 'com']">
   <dtml-call "REQUEST.path.append('site_one')">
</dtml-if >

<dtml-if "_.string.split(_.string.lower(_.string.split(HTTP_HOST, ':')[0]),
'.')[-2:]==['site_two', 'com']">
   <dtml-call "REQUEST.path.append('site_two')">
</dtml-if >

At the end, add a "SiteRoot" object in the folder "site_one" with this
content:
Base: http://www.site_one.com
Path: /

Do the same for folder "site-two".

Enjoy.
----- Original Message -----
From: "Gitte Wange" <gitte@mmmanager.org>
To: <zope@zope.org>
Sent: Friday, June 15, 2001 1:29 PM
Subject: Re: [Zope] Several domains and one Zope


> On Friday 15 June 2001 12:55, you wrote:
> > I run 7-9 different domains out of one Zope.
> >
> > - Zope 2.3.2
> > - A folder in the root of Zope for each site
> > /site_one (named specific to site)
> > /site_two
> > /site_three
> > - A virtual_host (set access rule) with the code for SiteAccess (see
> > Zope.org) - A SiteRoot in every folder (no base, no bath).
> >
> > This really works like a charm. There are a few oddities in terms of
> > things like breadcrumbs and that Zope puts them all in one log
> > (Z2.log) which I have never found an answer for, but otherwise it is
> > really a great thing.
> >
> > Enjoy,
> > BZ
> >
>
> Thanx for your help but ... :-)
>
> Where does apache show up in your setup ?
> Sorry I forgot to mention that in my problem description .. sorry
>
> Regards,
> --
> Gitte Wange Jensen
>
> Sys Admin, Developer and a lot more
> +45 29 72 79 72
>
> gitte@mmmanager.org
>
> Quote of the day:
> I'm having a RELIGIOUS EXPERIENCE ... and I don't take any DRUGS
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>