[Zope] Multiple domains from one server process?

Andreas Kostyrka andreas@mtg.co.at
Sun, 27 Jun 1999 17:48:53 +0200 (CEST)


Hi!

I've been wondering how to serve more than one site from one Zope
installation. (Why? 1. Resources. 2. Sites are sometime linked on an
               organization level that make this kind of sharing
               sensible.)

At the moment I have done the following:
http://www.mtg.co.at/           is the real root of the Zope installation
http://www.mtg.co.at/sites/photoderm.at/
                                is one subsite.
http://www.photoderm.at/        points in the Apache RewriteRule to 
                                mtg.cgi/sites/photoderm.at/$1.

Now this basically works ok, but there are certain problems:
When accessing http://www.photoderm.at/, Z adds a BASE tag with href
http://www.photoderm.at/sites/photoderm.at/

In this case this works ok, as Z finds the correct stuff via acquisition,
but in the more general case (when one of the subsites has a sites object
itself), this would break.

I've fixed it the quick and dirty way by adding the following to the
standard_html_header of the site, but this is not perfect, nor clean.
...
<!--#if expr="BASE0=='http://www.photoderm.at'"-->
<!--#call expr="REQUEST.set('rbase',
    _.string.join(_.string.split(URL0,'/')[0:3]+
                  _.string.split(URL0,'/')[5:-1]+['',],'/'))"-->
<BASE HREF="<!--#var rbase-->">
<!--#else-->
<!--#call expr="REQUEST.set('rbase',URL1)"-->
<!--#/if-->
...

It seems that this should be doable somehow better, as codeit
(http://codeit.com/zsetup.html) offers to do this.

Andreas
-- 
Win95: n., A huge annoying boot virus that causes random spontaneous system
     crashes, usually just before saving a massive project.  Easily cured by
     UNIX.  See also MS-DOS, IBM-DOS, DR-DOS, Win 3.x, Win98.