.:An Endless Journey:.
open source and me
  • Immutable Page
  • Info
  • Attachments

Standalone MoinMoin on Gentoo

Background

MoinMoin can be installed and configured with a few different mode. By default ebuild and webapp-config will guide you to a mod_python setup. For some reason, you may want to go with the standalone + apache mod_proxy (rev. proxy) approach.

The following is my notes on this issue.

Steps

In this HOWTO, I will install one MoinMoin instance under /srv/moin/main. The full operation have three steps:

  1. Install MoinMoin

  2. Create MoinMoin instance on /srv/moin/main

  3. Configure Apache to enable reverse proxy

Install MoinMoin

Install MoinMoin on Gentoo is very easy, simply "emerge moinmoin". Note, you should enable 'vhost' useflag. Without do so, portage will prepare a MoinMoin setup in the default web server document root. (We want a standalone setup now!) $ emerge -Dav moinmoin

Create MoinMoin Instance

MoinMoin support support instance installation, so I choose to create a MoinMoin instance in /srv/moin/main. Later on, if there are needs to create other instance, I can create instance on /srv/moin/[otherInstanceName]. Anyway, it isn't a requirement, MoinMoin instance can install on any other location.

MoinMoin have a script to setup an installation instance See this url for more information:

Download the script can execute it to create a instance for you {{{$ wget -O createinstance.sh \ 'http://moinmaster.wikiwikiweb.de/HelpOnInstalling/ WikiInstanceCreation?action=AttachFile&do=get&target=createinstance.sh' ./createinstance.sh}}}

Then, copy one program from /usr/share/moin/server/moin. The program can let you start MoinMoin as daemon.

cp /usr/share/moin/server/moin /srv/moin/main/

Set your MoinMoin instance path in the program, edit /srv/moin/main/moin, and set the line as follow.

sys.path.insert(0, '/srv/moin/main')

Start the MoinMoin standalone server:

/srv/moin/main/moin

And you can test it with local only URL:

firefox http://localhost:8000/

Configure Apache to enable reverse proxy

Edit /etc/conf.d/apache2 and add "-D PROXY" in the APACHE2_OPTS Edit /etc/apache2/httpd.conf

ProxyRequests Off

You can put this line in anywhere, however, I choose to put it following the <IfDefine PROXY>...</IfDefine> block. In order to put global proxy related setting together.

Finally, turn on reverse proxy mapping. I use virtual host, hence, I put the following block within my virtual host definition:

    # MoinMoin reference static resource with /wiki prefix
    Alias                   /wiki       /usr/share/moin/htdocs
    <Location /moin/>
        ProxyPass http://localhost:8000/
        ProxyPassReverse http://localhost:8000/
        RequestHeader set X-Moin-Location /moin/
    </Location>