I wanted to implement a Personal Wiki, and considered using MediaWiki since it's offered by Dreamhost as a 'One-Click Install', but after investigating wiki software, I decided to use MoinMoin. I found the installation instructions spread out among several different wiki pages, and a little bit difficult to grok. After searching the web for some Dreamhost specific installation instructions, I found a couple sites that offered some helpful information, but still no complete picture.

My goal was to write a concise HOWTO that would allow a moderately experienced user to setup a simple wiki on a Dreamhost account with as little pain as possible. The steps below should provide enough detail to configure MoinMoin on both a standard CGI site and FastCGI enabled site. Also included are instructions for using Apache mod_rewrite to serve cruft-free URLs.

Feedback is welcome. WEB/IM/IRC Info


This tutorial assumes you have enabled shell access to your Dreamhost shared-hosting account. If you are not sure how to do that, see this link.

Use your favorite SSH Client to login to your shell account and download the latest release to your home directory.

wget http://prdownloads.sourceforge.net/moin/moin-1.5.8.tar.gz?download

Now, unpack the archive, and change to the directory that contains the MoinMoin files.

tar -xzvf moin-1.5.8.tar.gz
cd moin-1.5.8

Setup and install

Install MoinMoin in your home directory by running setup.py.

python setup.py --quiet install --prefix=$HOME --record=install.log

This creates (if they don't already exist) and populates the following directories:

Create a wiki instance

A wiki 'instance' is a directory that contains all of the data and templates for your wiki.

Set up some shell variables to make following steps easier.

export MOIN=$HOME/share/moin
export WIKI=$MOIN/mywiki   # the name of your wiki instance, don't use 'wiki'
export SITE=$HOME/<www.example.com>   # replace <www.example.com> with your domain

Change to the MoinMoin 'templates' directory

cd $MOIN

Create a directory to hold your wiki 'instance' and copy the required template files.

mkdir $WIKI
cp -R $MOIN/data $MOIN/underlay $MOIN/config/wikiconfig.py $WIKI/

Set the appropriate permissions.

chmod -R ug+rwX $WIKI
chmod -R o-rwx $WIKI


Wiki instance (wikiconfig.py)

Configure your wiki instance by editing $WIKI/wikiconfig.py

Start with the "Wiki Identity" section.

sitename = u'Untiled Wiki'  # Name your wiki
logo_string = u'<img src="/htdocs/common/moinmoin.png" alt="MoinMoin Logo">'

Uncomment (remove the leading '#') one of the following:

#page_front_page = u"MyStartingPage"
#page_front_page = u"FrontPage"

Now set options in the "Critical Configuration" section.

data_dir = '/home/<username>/share/moin/mywiki/data/'   # Replace <username> with your account
data_underlay_dir = '/home/<username>/share/moin/mywiki/underlay/'    # Replace <username> with your account
url_prefix = '/htdocs'

Web site (domain)

Change to your 'domain' folder, and create a cgi-bin directory.

cd $SITE
mkdir $SITE/cgi-bin   # if it doesn't already exist
cp $MOIN/server/moin.cgi $MOIN/server/moin.fcg $SITE/cgi-bin/
chmod -R a+rx $SITE/cgi-bin

Do one of the following:

MoinMoin Application (moin.fcg or moin.cgi)

If your domain is configured to support FastCGI, configure moin.fcg, if not (or you don't know), configure moin.cgi instead.

Edit $SITE/cgi-bin/moin.fcg (or moin.cgi).

# Path to MoinMoin package, needed if you installed with --prefix=PREFIX
# or if you did not use setup.py.
sys.path.insert(0, '/home/<username>/lib/python2.3/site-packages')   # Replace <username> with your account

# Path of the directory where wikiconfig.py is located.
sys.path.insert(0, '/home/<username>/share/moin/mywiki')   # Replace <username> with your account

Test Your Wiki

Open a web browser and type one of the following URLs in the address bar (replace <www.example.com> with your domain URL):

For FastCGI sites: http://<www.example.com>/cgi-bin/moin.fcg

For standard CGI sites: http://<www.example.com>/cgi-bin/moin.cgi


CSS Does Not Load

Wiki loads, but appear 'ugly':

Cruft-free URLs

I prefer simple addresses on my site, so the thought of URLs like http://<www.example.com>/cgi-bin/moin.fcg?FrontPage didn't thrill me. I wanted something like http://<www.example.com>/wiki/FrontPage. This is possible with MoinMoin, but takes a little bit of reconfiguration, and some Apache Voodoo.

Edit $WIKI/wikiconfig.py and change the url_prefix.

url_prefix = '/_static'

For FastCGI enabled sites, edit $SITE/cgi-bin/moin.fcg:

For standard CGI sites, edit $SITE/cgi-bin/moin.cgi:

Edit $SITE/.htaccess, and add the following lines before any other mod_rewrite sections:

Make sure the last RewriteRule references the correct moin script based on your configuration (moin.fcg or moin.cgi)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^_static(.*)$ htdocs$1
RewriteRule ^wiki/(.*)$ cgi-bin/moin.fcg/$1 [L] # OR cgi-bin/moin.cgi/$1

NOTE: mod_rewrite can be a little tricky. This configuration works correctly on my installation... YMMV.

You may need to restart the moin process.

killall python

Now, test your site using the following URL (replace <www.example.com> with your domain URL):


If all went well your wiki is available using a simple, cruft-free URL


Dreamhost Wiki: http://wiki.dreamhost.com/MoinMoin

Installing MoinMoin at Dreamhost: http://www.wombatnation.com/misc/installMoinMoinDreamHost.html

MoinMoinBugs/RewritingAndCookieUrl: http://moinmoin.wikiwikiweb.de/MoinMoinBugs/RewritingAndCookieUrl


HOWTO/Install MoinMoin On Dreamhost (last edited 2009-02-23 16:24:22 by MitchContla)