How to do virtual hosting without using Apache |
![]() |
Created by jmeile . Last modified 2006-06-16 09:43:47. |
Describes an alternative to do it on zope versions older than 2.5.x. Newer versions should use a VirtualHostMonster. |
Somebody told me that there is a better way of
doing this with just a VirtualHostMonster in
your root folder, then define the virtual domains
in the mappings tab. Unfortunatelly, by that time
I've already done this How-To. Please note that
the last solution will only work with versions
newer than 2.5.x. Previous versions don't have
the mappings tab, so on this case, you can use my
solution.
After a lot of reading, I found a solution that
makes virtual hosting combining TinyTables,
AccessRules and SiteAccess without using Apache. I took some ideas and code from the SiteAccess info page and this Zope-Tip.
Differences:There are three main differences between the previously mentioned How-to and my solution:
Precautions:Because AccessRules are not only powerful but also dangerous, as all the How-Tos and Tips that I've read start, I've to repeat something here:Make everything on a test site and copy its Data.fs* files, so, if you make a mistake you can overwrite them. If I were you, I wouldn't do it in my main Zope Site before I'd be sure that it works because you could block your Zope if you set an invalid AccessRule and your site would be off-line. Anyway, just in case, if you can't access your manage interface, type the following: http://www.mysite.com/_SUPPRESS_ACCESSRULE/manage and then set the AccessRule to "No Access Rule" there. Before you put everything on your main zope site, make a backup, so you can undo the changes after.
Steps to activate Virtual Hosting:
Id: VirtualLinks Title: Write virtual links and their local paths here Columns: domain path Inside this table you should put your virtual hosts: Don't give access to anonymous and give manager all the rights. Id: getDomainPath Title: Looks for a match on the VirtualLinks table Don't give access to anonymous, set the proxy as manager and give manager all the rights. Id: redirectToHost Title: Redirects all the requests to the right virtual server Set the proxy as manager and set it as the AccessRule and that's all.
Recommended Links:
If there is a bug or something is missing, please let me now:
|