[Moin-user] multiple wikis on same virtual host

Rick Vanderveer rick.vanderveer at gmail.com
Tue Oct 28 12:08:16 EDT 2008

Hey JT,
What you want to do is definitely possible and fairly straightforward. Like
you, I didn't want to have to configure DNS each time I added a new project
wiki.  I think I know where you got hung up, because the example in the
farmconfig-py file does seem to be configured in a virtual hosts situation.
However, this is not necessary at all.  Here's what I have:

In my apache httpd.conf file:

ScriptAlias /main               "D:/moin/moin.cgi"
ScriptAlias /programming   "D:/moin/moin.cgi"
ScriptAlias /marketing        "D:/moin/moin.cgi"

Yes, it's perfectly fine to point them all at the same .cgi file, there's
nothing in there that would be specific to an individual project wiki that
wouldn't apply to all of them.  And you can add as many as you need to.

Then, in the farmconfig.py file, I have:

    ("main",  r"^.*.mycompany.com/main.*$"),
    ("programming",  r"^.*.mycompany.com/programming.*$"),
    ("marketing",    r"^.*.mycompany.com/marketing.*$"),

I originally had, for example,     ("main",  r"wiki.mycompany.com/main.*$"),
but I replaced the "wiki" part with "^.*" because I have a virtual machine
set up to test wiki code and upgrades, and wanted to use the exact same
farmconfig.py file.  So, replacing that part allows me to use the same file
in both places.

I hope this helps.  I also hope you will create a new wiki page that will
document this better.  I too struggled a bit when I initially set mine up,
and the documentation is a bit thin in this area and can use clarifying.


On Mon, Oct 27, 2008 at 2:10 PM, JT Moree <jtmoree at kahalacorp.com> wrote:

>  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.
> 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
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Moin-user mailing list
> Moin-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/moin-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/moin-user/attachments/20081028/5899efe8/attachment.html>

More information about the Moin-user mailing list