Warning

This document hasn't been checked for compatibility with current versions of Plone. Use at your own risk.

Virtual Hosting serveral sites under Windows

by mawi — last modified Dec 30, 2008 03:01 PM
This howto explains how to use the VirtualHostMonster to host several sites under Windows.

It is really quite easy to use the built in (Zope) function VHM - Virtual Host Monster - to set up a vanilla (windows, using standard plone installer) installation to serve out different sites. There is one trick that might drive you mad before you know it.

This applies only if:

  • you're using Windows
  • you're not using Apache or some other front-end webserver

So:

  • Install Plone if you havent already
  • Add and set up plone site from the ZMI (you use the drop down from the root)
  • Add a VHM in the ZMI root, using the add dropdown. Must be in the root. Name does not matter.
  • Click the new VHM node in the root that you just created, read instructions on the first tab. Re-read until you go nuts. Then choose the other (mappings) and enter the mappings: Really, if you have a domain mydomain.com and you created a Plone site in the ZMI root with the name mydomain you need to put an entry mydomain.com/mydomain. If you want to have it answer to www. you also need an entry for that (ie www.mydomain.com/mydomain).
  • Here is the trick: We are NOT done! Save the mappings and then go to the plone installation catalog on your harddrive, into the directory Plone 2\Data\Products\CMFPlone\Extensions. There you will find a file accessRule.py with some instructions. Follow them or do what i did, replace the last three lines with some null statement (like pass):
      def accessRule(self, *args):
          pass
    
  • Restart Zope from the ZMI control panel and everything should work.

Contribute

Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.