Best way to run virtual web sites using Zope??
I am interested in creating several web sites of the form Fire.mydomain.com Water.mydomain.com Earth.mydomain.com Sky.mydomain.com The "elements" are incidental! I would like to keep things on a single server. Can I do this?? It seems like Apache does this kind of thing, but I don't have much experience with it. The sites, BTW, do not necessarily have anything to do with each other and will probably be completely different so sharing and inheriting between sites is not a concern (unless it can be done!!) Thanks for your help. -- Robert Geiger robert@geigers.net
Robert Geiger wrote:
I am interested in creating several web sites of the form
Fire.mydomain.com Water.mydomain.com Earth.mydomain.com Sky.mydomain.com
The "elements" are incidental! I would like to keep things on a single server. Can I do this?? It seems like Apache does this kind of thing, but I don't have much experience with it.
Here's how you do it with a naked (wo_pcgi) zope: Make a SiteRoot folder with *nothing* in it (no default path) in the root folder and in folders for your subdomains. Then use this access_rule: Get subdomain: <dtml-let subdomain="_.string.join(_.string.split(_.string.split(HTTP_HOST, ':')[0], '.')[0], '')"> Is there a folder named as this subdomain? <dtml-try> <dtml-if "_[subdomain]"> Set logical root: <dtml-call "REQUEST.set('SiteRootPATH', '/')"> Add physical root: <dtml-call "REQUEST.path.append(subdomain)"> </dtml-if> <dtml-except KeyError> Set logical root: <dtml-call "REQUEST.set('SiteRootPATH', '/')"> </dtml-try> </dtml-let> You can host... many subdomains this way :) Make sure your DNS lists the same address for each subdomain. Oh, and on a random note, AccessRules *are* nestable. That rocks. good luck! -- ethan mindlace fremen mindlace@imeme.net zope -&- imap email -&- mailing list weave your web with the web at http://imeme.net
I am interested in creating several web sites of the form
Fire.mydomain.com Water.mydomain.com Earth.mydomain.com Sky.mydomain.com
The "elements" are incidental! I would like to keep things on a single server. Can I do this?? It seems like Apache does this kind of thing, but I don't have much experience with it.
Well, as with everything, there are choices, multiple choices infact, some of which follow: - You could run a copy of zope for each site. If you do this, then you have a further choice: - You could expose zope directly to each host. This you could do if you have a separate IP address for each host. Each zope could then be configured to listen on port 80 to that IP address. - You could proxy each zope behind something like apache. This you could do either based on IP address, or via Virtual Hosts off the one IP address. - You could run one copy of zope and have each site on different parts of this zope. If you do this then you need to put zope behind something like apache as described above. You would also want to employ Site Root for each site. It depends a lot on what you want to achieve, what options you have available to you (eg. IP addresses) and how much control you have over the setup (apache, lots of zopes, ports, etc.) Once you have answered these questions, you can narrow down the options and start to make some decisions.
The sites, BTW, do not necessarily have anything to do with each other and will probably be completely different so sharing and inheriting between sites is not a concern (unless it can be done!!)
You certainly have the option of running the sites off a shared zope which would allow you to share resources. Cheers, Stephen -- Stephen Harrison - stephen@nipltd.com New Information Paradigms - www.nipltd.com
participants (3)
-
mindlace -
Robert Geiger -
Stephen Harrison