[Zope] Vhosting
Charlie Reiman
creiman@kefta.com
Fri, 23 Aug 2002 09:05:56 -0700
You should also read the 2.6 docs on VHM. They're downright tasty.
http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/VirtualHosting.s
tx
They apply to 2.5.1 as far as I noticed.
> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Marc
> Lindahl
> Sent: Thursday, August 22, 2002 11:42 PM
> To: Quentin Smith; Adam Getchell
> Cc: 'zope@zope.org'
> Subject: Re: [Zope] Vhosting
>
>
> Try:
> http://www.zope.org/Members/bowerymarc/squid-zserver-virtual
>
>
> on 8/22/02 10:15 PM, Quentin Smith at quentins@comclub.dyndns.org
> scrivened:
>
> > Hi-
> > Use a Virtual Host Monster, one in the root of the site. Ideally, you
> > should put Apache or Pound in front of Zope instead of squid, but you
> > can use the Mappings tab of the Virtual Host Monster to define the
> > virtual hosts. I used to use SiteRoots for my site, and none of the
> > directions I found actually worked.
> > HTH,
> > --Quentin
> > On Thursday, August 22, 2002, at 08:27 PM, Adam Getchell wrote:
> >
> >> Hello all,
> >>
> >> I've read and re-read
> >> http://www.zope.org/Members/4am/SiteAccess2/vhosting a
> >> number of times.
> >>
> >> I have a webserver that needs to host a bunch of different sites,
> >> site1.ucdavis.edu, site2.ucdavis.edu, etc.
> >>
> >> I planned to use name based redirection, so I have c-names to the IP
> >> address
> >> of the server, i.e. site1.ucdavis.edu --> IP, site2.ucdavis.edu --> IP,
> >> etc.
> >>
> >> I installed on OpenBSD, so Zope runs as an instance in /home/zoperoot
> >> under
> >> port 8080, and Squid sits in front of it and redirects from 80 to port
> >> 8080.
> >> This part is working fine.
> >>
> >> Under my main zope site, I created two folders, site1 and site2. I then
> >> created, in each folder, an empty SiteRoot. That is, Title, Base, and
> >> Path
> >> are all blank. At least, that's how I interpreted the directions above.
> >>
> >> I then created a DTML method called host_redirector, with the following
> >> content:
> >>
> >> Extract the part of HTTP_HOST we care about, and declare our rewrite
> >> dictionary.
> >> <dtml-let hostname="_.string.upper(_.string.split(HTTP_HOST, '.')[0])"
> >> sitemap="{'SITE1': 'site1',
> >> 'SITE2': 'site2'}">
> >> Do we have a match?
> >> <dtml-if expr="sitemap.has_key(hostname)">
> >> Set the logical root: <dtml-call "REQUEST.set('SiteRootPATH', '/')">
> >> Add physical root: <dtml-call
> >> "REQUEST['TraversalRequestNameStack'].append(sitemap[hostname])">
> >> </dtml-if>
> >> </dtml-let>
> >>
> >> Since I only care about the first part of the name, I rewrote
> the script
> >> from the example. It may be incorrect! I tried the equivalent at a
> >> python
> >> interpreter, but I may certainly have goofed up.
> >>
> >> In the root folder, I Set an Access rule to host_redirector.
> >>
> >> I changed the index pages in each of Site1 and Site2 to differentiate
> >> them.
> >> However, going to site1.ucdavis.edu gives the top level index_html,
> >> while
> >> going to site1.ucdavis.edu/site1 gives index_html in the Site1 folder,
> >> so
> >> clearly I did something wrong.
> >>
> >> Any pointers?
> >>
> >> ***************************
> >> * Adam Getchell
> >> AdamG@hrrm.ucdavis.edu
> >> * System Architect/Programmer (530) 752-1584
> >> * Human Resources Information Systems
> >> http://www.hr.ucdavis.edu/
> >> ***************************
> >> "Invincibility is in oneself, vulnerability in the opponent."
> -- Sun Tzu
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> 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 )
> >>
> >
> >
> > _______________________________________________
> > 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 )
> >
>
>
> _______________________________________________
> 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 )
>