[Moin-user] multiple wikis on same virtual host

JT Moree jtmoree at kahalacorp.com
Mon Oct 27 15:10:14 EDT 2008


I googled for this but found no revelvant links.  I've also looked at
the main wiki site but this case is not covered.

Generally, the moinmoin setup seems to work best when using DNS to
differentiate between wiki sites but I'd prefer to cut out the overhead
of creating multiple DNS entries.

Unfortunately this requires more overhead in configuring apache or some
creative setups.  I've hacked together a solution that works but I'd
like to hear some feedback from others.

I'm using Ubuntu so some of my setup is specific to the way debian is
packaging moinmoin but I find that I'm having to make copies of some of
the files and re-arrange things anyway.

STEPS

First I installed with apt.  The version I got is
python-moinmoin   1.5.8-5.1ubuntu2

Next I got the single and farm sites working as virtual hosts then I
started changing things.

I don't want to create a new virtual host in apache for every new site
for the same reason I don't want to create multiple dns entries.  The
files are all the same that run the site.  Only the data and some part
of the url needs to be different.

I am using an apache virtual host with this configuration
  <VirtualHost *>
        ServerName      wikidev-dev.kahalacorp.com
        DocumentRoot    /var/www/vhosts/bugs-dev.kahalacorp.com/
        AddHandler cgi-script .cgi

        # Use default themes
        Alias           /wiki/ /usr/share/moin/htdocs/
  </VirtualHost>

I copied the contents of the server folder which contains the moin.cgi
script from /usr/share/moin to /var/www/vhosts/bugs-dev.kahalacorp.com/

Next I create a symlink in that folder for the sites I want to
differentiate from each other
  cd /var/www/vhosts/bugs-dev.kahalacorp.com/
  ln -s moin.cgi a.cgi
  ln -s moin.cgi b.cgi
  ln -s moin.cgi c.cgi

Then I tell farmconfig.py how to get to the sites
    # for multiple wikis, do something like this:
    ("c",  r"^bugs-dev.kahalacorp.com/c.cgi/*"),
    ("b",  r"^bugs-dev.kahalacorp.com/b.cgi/*"),
    ("a",  r"^bugs-dev.kahalacorp.com/a.cgi/*"),

Create the folders to hold the data and set perms
  mkdir -p /var/moin/a/data
  mkdir -p /var/moin/a/underlay

  chmod -R ug+rw /var/moin
  chown -R www-data:www-data /var/moin

Lastly I configure each site's .py file and set the data_dir and
data_underlay_dir.  (this is a rough approximation)
  cp /etc/moin/mywiki.py /etc/moin/a.py
  printf "    data_dir = '/var/moin/a/data'\n    data_underlay_dir =
'/var/moin/a/underlay'\n" > /etc/moin/a.py 
 
-  
JT Moree
System Admin
www.kahalacorp.com
480.362.4800
480.362.4405 direct

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/moin-user/attachments/20081027/453afb56/attachment.html>


More information about the Moin-user mailing list