MoinMoin

From DreamHost
Jump to: navigation, search

MoinMoin is a wiki written in Python. See http://moinmo.in

While the official wiki software on DreamHost is MediaWiki, MoinMoin is a very fine wiki that some may prefer.

This was updated for MoinMoin 1.5.8 and simplified with some extra comments added as I was new no unix commands and it took me 40+ hrs to get it working.

Note: For the purpose of the following “username” is the username Dreamhost has assigned you on your server. Generally it is your original logon name found in the email they sent you upon registering. “Mydomain.com” is the domain you are creating a wiki in once MoinMoin is installed Ie: Your home directory is: /home/username/ and the 1st wiki you are creating is /home/username/mydomain.com/

Installation

On DreamHost, MoinMoin must be installed as a user program.

  1. Download the distribution, upload to your dreamhost account, and unpack. You can use any FTP program (I like WinSCP as it is free and secure) or the webftp.dreamhost.com/
  2. Install in your home directory. For example, installing version 1.5.8:

The following commands are performed in a SHELL enviroment via a commandline (like old DOS programs for you windows users). Use a program like PUTTY which you can download for free. Logon to your ftp server that was assigned to you using your FTP ID and password. Be aware if you can't log in you have to go to your DreamHost control panel and under "Manage Users" and edit your user ID to allow for SHELL access (default is FTP access only).

    1. tar -xvzf moin-1.5.8.tar.tar
    2. cd moin-1.5.8
    3. python setup.py --quiet install --prefix=$HOME --record=install.log
    4. cd

This creates the directories:

  • /home/username/bin/
  • /home/username/lib/python2.3/site-packages/MoinMoin/
  • /home/username/share/moin/

Setting up a WikiFarm

Since DreamHost supports multiple domains per account, it makes sense to me to setup a WikiFarm instead of a single instance. This way you can make as many wiki's as you want and allows for easy bulk upgrading of MoinMoin when an update comes out.

  1. Create a directory to hold the wikis. This is the directory you'll want to backup regularly. Note: $HOME is just a shortcut for typing /home/username/
    1. mkdir $HOME/wikifarm
    2. cd $HOME/wikifarm (you are now in /home/username/wikifarm)
    3. mkdir config
    4. mkdir wikis
  2. Point to the underlay directory, as it won't change.
    1. ln -s $HOME/share/moin/underlay .
  3. Copy the farmconfig and customize it
    1. cp $HOME/share/moin/config/wikifarm/farmconfig.py config/farmconfig.py
  4. Now config the farmconfig.py file. Use an ssh editor (vi, emacs) or double click on the file from WinSCP to edit it. Below I will assume you are using emacs (easier than vi)
    1. emacs config/farmconfig.py
      • Set up the default settings for all wikis in the farm
      • I recommend setting an absolute path for 'data_underlay_dir'
    2. This is poorly documented elsewhere and so this is what I did through trial and error.
    3. Change the line: ("mywiki", r".*"), # this is ok for a single wiki
    4. To: #("mywiki", r".*"), # this is ok for a single wiki
    5. Change : data_underlay_dir = './underlay/'
    6. To: data_underlay_dir = '/home/username/share/moin/underlay/'
    7. Change other settings like superuser and acl rights as you want. I left the data_dir = './data/' and the url_prefix = '/wiki' alone and it seemed to work. Be aware that I think the ./ in this file refers to the directory where moin.cgi runs from.
    8. Press ctrl-x then press ctrl-s then press ctrl-x then press ctrl-c to save and exit emacs
  1. Set up the common CGI script
    1. mkdir $HOME/wikifarm/bin
    2. cp cp $HOME/share/moin/server/moin.cgi bin
    3. emacs bin/moin.cgi
      • update the sys.path.insert statements:
Change: ## sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
To (remember to remove the ##): sys.path.insert(0, '/home/username/lib/python2.3/site-packages')
Change sys.path.insert(0, '/path/to/wikiconfig')
To: sys.path.insert(0, '/home/username/wikifarm/config')
    1. Press ctrl-x then press ctrl-s then press ctrl-x then press ctrl-c to save and exit emacs

Add a Wiki instance to the farm

  1. Create a directory for the wiki instance (here named "myfirstwiki")
    1. cd
    2. mkdir $HOME/wikifarm/wikis/myfirstwiki
  2. Copy the seed pages
    1. cp -R share/moin/data wikifarm/wikis/myfirstwiki
  3. Copy the wikiconfig and customize it
    1. cp share/moin/config/wikifarm/mywiki.py wikifarm/config/myfirstwiki.py
    2. emacs wikifarm/config/myfirstwiki.py
      • Change the names of 'MyWiki' "MyStartingPage" to whatever you want.
      • If your wiki is only in one language remove the # from #page_front_page = u"MyStartingPage" and add a # to page_front_page = u"FrontPage"
      • Change the data_dir = '/org/mywiki/data/' to your new wiki's data directory data_dir = '/home/username/wikifarm/wikis/myfirstwiki/data/'
    3. Press ctrl-x then press ctrl-s then press ctrl-x then press ctrl-c to save and exit emacs
  1. Add the new wiki to the farm
    1. emacs wikifarm/config/farmconfig.py
      • In particular, add the wiki to the array of wikis:
Right above the line that says "# for multiple wikis", do something like this:
Add the following line (be sure to indent it to match the other lines) also change the “mydomain.com” to the name of the domain you are running your wiki from (the Dreamhost directory /home/username/mydomain.com/):

    ("myfirstwiki", r"^([A-Za-z0-9-]*\.)*mydomain.com/myfirstwiki.cgi(/.*)?"),

    1. Press ctrl-x then press ctrl-s then press ctrl-x then press ctrl-c to save and exit emacs
  1. Then setup cgi script under document root (the base of your mydomain.com directory)
    1. cd $HOME/mydomain.com
    2. emacs myfirstwiki.cgi # a soft link won't work, so we create a small shell script. In the emacs window that opens up instert the following with the #!/bin/sh on the very first line.
#!/bin/sh
/home/myusername/wikifarm/bin/moin.cgi
    1. Press ctrl-x then press ctrl-s then press ctrl-x then press ctrl-c to save and exit emacs
    2. chmod +x myfirstwiki.cgi
    1. You can now test run your wiki by going to your website in a browser and typing http://www.mydomain.com/testwiki.cgi

Fix the CSS

You're wiki should now be working, but ugly. We need to map the /wiki directory

    1. cd $HOME/mydomain.com
    2. ln -s ~/share/moin/htdocs wiki
    3. emacs .htaccess
options +FollowSymLinks


    1. I have not gotten as far as to see if the following works simply for 1.5.8 so I leave you on your own.

Getting rid of the .cgi in the URL

Normally this would be done with the Apache directive 'ScriptAlias' but that requires access to the httpd.conf file. It's not a legal option in the .htaccess file. Instead, we use ModRewrite and a special RequestHeader that tells MoinMoin what to use in the URLs it creates.

ReWriteEngine on
ReWriteRule ^myfirstwiki(/.*)? myfirstwiki.cgi$1
RequestHeader set X-Moin-Location /myfirstwiki

Also, update the declaration of the wiki in farmconfig.py to take out the ".cgi"

    ("myfirstwiki", r"^([A-Za-z0-9-]*\.)*mydomain.com/myfirstwiki(/.*)?"),

Unfortunately, the page name gets lost by MoinMoin when you do this, and every page returns the contents of the FrontPage. I had to comment out the lines

        # This may happen when using mod_python
        #if scriptAndPath.startswith(location):
        #    self.path_info = scriptAndPath[len(location):]

in request.py (about line 509). Since I'm not using mod_python, I'm assuming it's OK. The problem is that it was leaving the ".cgi/" prepended to the pagename in the path_info variable. See http://moinmo.in/MoinMoinBugs/SiteLocationBrokenByModPythonPatch for the bug report.

Fast CGI

Once you get everything set up and working, you can easily switch to fast cgi.

  1. Copy the required fast cgi script
    1. cp $HOME/share/moin/server/moin.fcg $HOME/wikifarm/bin
    2. Edit $HOME/wikifarm/bin/moin.fcg and include the site-packages and farm config dir into the sys.path variable
  2. Setup fcg script under document root
    1. cd $HOME/mydomain.com
    2. vi myfirstwiki.fcg # a soft link won't work, so we create a small shell script
#!/bin/sh
/home/myusername/wikifarm/bin/moin.fcg
  1. chmod +x myfirstwiki.fcg
  2. Change the rewrite rule
ReWriteRule ^myfirstwiki(/.*)? myfirstwiki.fcg$1

Allowing One Letter Words in WikiWords

MoinMoin doesn't recognize one-letter words within WikiWords. That is AWikiWord is not considered A WikiWord.

If you want to change this behavior, you can apply the patch contributed to MoinMoin's feature requests.

To apply the patch, download it, look for the wiki.py in the parser directory of MoinMoin, and apply it. You can easily do this in just one step (supposing MoinMoin is installed in /home/username) with the following commands:

cd /home/username/lib/python2.3/site-packages/MoinMoin/parser
wget -O - \
 'http://moinmo.in/FeatureRequests/OneLetterWordInWikiWords?action=AttachFile&do=get&target=wiki.py-OneLetterWikiWords-1.5.5a.patch' \
 | patch

Alternative instructions based on Unix account setup with a local configuration for Python

Download and install MoinMoin

# this is an EXAMPLE, replace the number with the actual version
# of MoinMoin that you are going to install (the new version)
# !!!!! make sure this is the rigth version !!!!!
export MOINNEWVERSION=1.6.3


cd ${HOME}/soft
wget http://static.moinmo.in/files/moin-${MOINNEWVERSION}.tar.gz
tar xvzf moin-${MOINNEWVERSION}.tar.gz
export MOINSRCDIR=${HOME}/soft/moin-${MOINNEWVERSION}
cd ${MOINSRCDIR}
python setup.py install --prefix=$RUN --record=${HOME}/log/setup/moin-${MOINNEWVERSION}-install.log


Initial configuration

Create environment variables and some directories

  • Create some environment variables to help you later and create some directories:

in the first environment variable (${WIKIADMIN}), replace WikiName you'll use for the administrator of the wiki (this will be the super user), you may use your actual name, or WikiAdmin or whatever you want. Be careful since you'll be giving this user permission for everything in the wiki.

# ${WIKIADMIN} The MoinMoin SUPER USER (be careful)
export WIKIADMIN=<The WikiName of the SuperUser for this installation>


# this is an EXAMPLE, replace the number with the actual version
# of MoinMoin that you are going to install (the new version)
# !!!!! make sure this is the rigth version !!!!!
export MOINNEWVERSION=1.6.3
export MOINSRCDIR=${HOME}/soft/moin-${MOINNEWVERSION}
export MOINSHORTVERS=${MOINNEWVERSION:0:1}${MOINNEWVERSION:2:1}${MOINNEWVERSION:4:1}


# ${PYVERS} Python version
export PYVERS=`${RUN}/bin/python -V 2>&1 | cut -d ' ' -f 2`
export PYVERSMAJOR=${PYVERS:0:3}
export PYLIBPKG=${RUN}/lib/python${PYVERSMAJOR}/site-packages

# ${SHARE} holds the common MoinMoin files
export SHARE=${RUN}/share/moin
# ${MOINBACKUP} will hold backups
export MOINBACKUP=${HOME}/backup/moin
# ${FARMDIR} will have the farm configuration file and
# the instances configuration directories (including
# the instance configuration file and the data directory)
export FARMDIR=${RUN}/etc/moinfarm
# ${WWWDIR} is the directory under which we place web
# sites directories.
export WWWDIR=${HOME}/www
mkdir -pv ${FARMDIR}
mkdir -pv ${FARMDIR}/TEMPLATES
mkdir -pv ${FARMDIR}/patches
mkdir -pv ${MOINBACKUP}
# Link the <code>underlay</code> directory to the ${FARMDIR} 
#(the data directories will be generated for each instance 
# of the farm)
ln -sv ${SHARE}/underlay ${FARMDIR}
ln -sv ${SHARE}/data ${FARMDIR}
mkdir -pv ${WWWDIR}
# ${WWWDIR} directory to hold a template to create instances
mkdir -pv ${WWWDIR}/MOIN-WIKI-TEMPLATE
# ${WWWDIR}/MOIN-SHARED directory to hold common files used by all
# instances (that have to be visible from the web).
mkdir -pv ${WWWDIR}/MOIN-SHARED
# ${WWWDIR}/MOIN-SHARED/SHARED directory to hold common files used by all
# instances (that have to be visible from the web).
mkdir -pv ${WWWDIR}/MOIN-SHARED/SHARED
# ${FARMDIR}/THEMES will hold the non-web-visible files for
# common themes
mkdir -pv ${FARMDIR}/THEMES


Create configuration files

Now, let's start massaging the configuration files... We'll get the farmconfig.py farm configuration file and the mywiki.py farm instance configuration file into our ${FARMDIR} branch. We'll convert these files to utf-8 (rather than iso-8859-1) since this is more flexible (we also change the internal declaration of charset coding so Python knows that the files are utf-8). We generate the INSTEMPLATE.py instance configuration file template based on mywiki.py:

iconv --from-code=ISO-8859-1 --to-code=UTF-8 ${SHARE}/config/wikifarm/farmconfig.py | \
   sed -e 's/# -\*- coding: iso-8859-1 -\*-/# -*- coding: utf-8 -*-/' > ${FARMDIR}/farmconfig.py
iconv --from-code=ISO-8859-1 --to-code=UTF-8 ${SHARE}/config/wikifarm/mywiki.py | \
   sed -e 's/# -\*- coding: iso-8859-1 -\*-/# -*- coding: utf-8 -*-/' > ${FARMDIR}/TEMPLATES/mywiki.py

sed -e 's/MyWiki/NAMEOFWIKI/' -e "s#/org/mywiki/data/#${FARMDIR}/NAMEOFINSTANCE/data/#" \
     <${FARMDIR}/TEMPLATES/mywiki.py >${FARMDIR}/TEMPLATES/INSTEMPLATE.py

Now, download and apply a patch to configure the file automagically:

cd ${FARMDIR}/patches
wget http://ybab.net/wiki.dreamhost.com/patches/farmconfig.py-${MOINNEWVERSION}.patch
# adapt the patch to our environment variable ${RUN}
sed -i.download -e "s#FARMDIRENVVAR#${FARMDIR}#" -e "s#WIKIADMINENVVAR#${WIKIADMIN}#" farmconfig.py-${MOINNEWVERSION}.patch
cd ${FARMDIR}
patch < ${FARMDIR}/patches/farmconfig.py-${MOINNEWVERSION}.patch

You now must configure the ${FARMDIR}/farmconfig.py to your liking.

  • Put in ${FARMDIR}/farmconfig.py all the settings you want applied to all the instances.
    • If you change something in this file after creating some instances, the changes will apply to all the instances (except those that have the exact same setting in its individual file).
  • You can also configure default settings that you might want to change individually. You must put these settings in ${FARMDIR}/TEMPLATES/INSTEMPLATE.py.
    • This file will be used to generate the individual configuration file for every wiki instance you create.
    • Once the file is generated, you'll be able to modify it again.
    • If you modify the ${FARMDIR}/TEMPLATES/INSTEMPLATE.py file after generating some instances, the changes in the template will only apply to instances created after the file was modified. The instances already created are not affected by these changes.

Prepare SHARED files and directories

Now you have to put the moin.cgi main script in the ${WWWDIR}/MOIN-SHARED shared directory. Let's convert this file also from iso-8859-1 to utf-8. Let's also create a suitable .htaccess file in there:

iconv --from-code=ISO-8859-1 --to-code=UTF-8 ${SHARE}/server/moin.cgi | \
   sed -e 's/# -\*- coding: iso-8859-1 -\*-/# -*- coding: utf-8 -*-/' > ${WWWDIR}/MOIN-SHARED/moin.cgi
# let's patch the file:
cd ${FARMDIR}/patches
wget http://ybab.net/wiki.dreamhost.com/patches/moin.cgi-${MOINNEWVERSION}.patch
# adapt the patch to our environment variable ${RUN}
sed -i.download -e "s#RUNENVVAR#${RUN}#" -e "s#PYLIBENVVAR#${PYLIBPKG}#" moin.cgi-${MOINNEWVERSION}.patch
cd ${WWWDIR}/MOIN-SHARED
patch < ${FARMDIR}/patches/moin.cgi-${MOINNEWVERSION}.patch
chmod --reference=${SHARE}/server/moin.cgi ${WWWDIR}/MOIN-SHARED/moin.cgi

cat >${WWWDIR}/MOIN-SHARED/.htaccess <<EOF
DirectoryIndex moin.cgi index.html
Options FollowSymLinks ExecCGI

# start the rewrite engine
RewriteEngine On
RewriteBase /

RewriteRule ^(static/|moin_static${MOINSHORTVERS}/|moin.cgi) - [last]

# Prevent failing on pages ending with "?"
RewriteRule ^(.*)\?$  moin.cgi/\$1\%3f [last]

# If you want to show the moin.cgi in the URLs, in moin.cgi
# comment out the line that says
#     properties = {'script_name': '/'}
# and comment the following line
RewriteRule ^(.*) moin.cgi/\$1 [type=application/x-httpd-cgi]
EOF

And copy the static files for this distribution also in the ${WWWDIR}/MOIN-SHARED directory:

cp -rp ${SHARE}/htdocs ${WWWDIR}/MOIN-SHARED/moin_static${MOINSHORTVERS}

If you want to use your own themes (or themes downloaded from MoinMoin's Theme Market), you have to do as follows:

  • For each theme name_of_theme
    • Put the name_of_theme.py file in ${FARMDIR}/THEMES
    • Put the name_of_theme directory in ${WWWDIR}/MOIN-SHARED/SHARED


Let's make a symlink to all of these directories in the moin_static${MOINSHORTVERS} directory so that they are available in all instances

cd ${WWWDIR}/MOIN-SHARED/moin_static${MOINSHORTVERS}

TARGET="${WWWDIR}/MOIN-SHARED/moin_static${MOINSHORTVERS}"

for theme in ${TARGET}/../SHARED/* ; do
  name=`basename $theme`
  if [ -e ${TARGET}/${name} ]
  then
    if [ -h ${TARGET}/${name} ]
    then
      echo "there already is a symlink ${name}:"
      ls -l ${TARGET}/${name}
    else
      echo "LOOKOUT! there's 'SOMETHING' in ${TARGET}/${name} but it's not a symlink:"
      ls -ld ${TARGET}/${name}
    fi
  else
    # there's nothing in ${TARGET}/${name}, so we create the symlink
    ln -sv ../SHARED/${name} ${TARGET}
  fi
done

Prepare a template for instances

This will simply have symbolic links to the files and directories in the ${WWWDIR}/MOIN-SHARED directory:

cd ${WWWDIR}/MOIN-WIKI-TEMPLATE
ln -sv ../MOIN-SHARED/* ../MOIN-SHARED/.htaccess .
# moin.cgi MUST be a real file, not a symlink or else, apache refuses to execute it
rm -f moin.cgi
cp -v ../MOIN-SHARED/moin.cgi .

Instances (sites)

Instance creation script

Now you have all set up, but for the sites themselves. In order to ease the creation of instances, download the create_moin_instance.sh script, copy it to a directory in your path and make it executable:

wget -O ${RUN}/bin/create_moin_instance.sh http://ybab.net/wiki.dreamhost.com/scripts/create_moin_instance.sh
chmod -v +x ${RUN}/bin/create_moin_instance.sh

Creating an instance of the farm

Suppose you have a domain called example.com and want to create a MoinMoin instance in a subdomain called my-great-wiki.example.com.

Go to the DreamHost panel and create the subdomain, my-great-wiki.example.com configuring the web directory to be /home/username/www/my-great-wiki.example.com/ (that is, add www/ in front of the auto-filled domain name in the form).

This will have created an empty directory called ${WWWDIR}/my-great-wiki.example.com.

Now, to create the instance, simply invoke the script create_moin_instance.sh with the apropiate parameters:

  1. Instance Name (a short name to identify your instance, only lowercase letters and numbers, starting with a letter). In this example: mygreatwiki
  2. Domain Name (the domain name for this wiki instance). In this example: my-great-wiki.example.com
  3. (optional) Wiki Name (the WikiName for this wiki. It must be a WikiWord). In this example: MyGreatWiki

The invocation would be:

create_moin_instance.sh mygreatwiki my-great-wiki.example.com MyGreatWiki

The output will be something like this:

Creating and populating instance directory /home/inst/run/etc/moinfarm/mygreatwiki
  creating symlinks to see the themes from /home/inst/run/etc/moinfarm/THEMES
Creating and populating web directory /home/inst/www/my-great-wiki.example.com
Creating instance configuration file /home/inst/run/etc/moinfarm/mygreatwiki/mygreatwiki.py
Generating farm configuration file /home/inst/run/etc/moinfarm/farmconfig.20070724_173742.py
  moving /home/inst/run/etc/moinfarm/farmconfig.py ===> /home/inst/run/etc/moinfarm/BACKUP_PRE-mygreatwiki.20070724_173742-farmconfig.py
  moving /home/inst/run/etc/moinfarm/farmconfig.20070724_173742.py ===> /home/inst/run/etc/moinfarm/farmconfig.py
Ready.
Old farm configuration file saved in /home/inst/run/etc/moinfarm/BACKUP_PRE-mygreatwiki.20070724_173742-farmconfig.py

Now, review the changes in ${RUN}/etc/moinfarm/farmconfig.py, note the new directory ${RUN}/etc/moinfarm/mygreatwiki which holds the instance configuration file mygreatwiki.py (you can edit it to your leisure) and the data directory, which will hold all the data for this wiki.

In ${HOME}/www/my-great-wiki.example.com you'll see symbolic links to the moin.cgi main script and shared direcotries as well as to an appropiate .htaccess file.

If you want to personalize any of these for a particular site, first replace the symlinks for a copy of the actual files and directories and then you can modify them only for this site.

Upgrading

At least within the 1.5.x branch, upgrading is easy. If you are using the setup specified here, you can use this instructions:

  • Add a variable with all the wikis you have created in your farm (it may be only one or quite a bunch). Use the name of the domain, no www. or http:// in front and no trailing slash.
  • Add a variable with the old version and one with the new version of MoinMoin
# this is an EXAMPLE, replace the list with your own domains
export MOINDOMAINS="example.org example.com example.net"
# this is an EXAMPLE, replace the number with the actual version
# of MoinMoin that you have installed and are going to backup
# (the old version)
export MOINOLDVERSION=1.5.4
# this is an EXAMPLE, replace the number with the actual version
# of MoinMoin that you are going to install (the new version)
export MOINNEWVERSION=1.5.8

Backup

Let's make a backup of everything. Your backups will be located in ${MOINBACKUP} (~/backup/moin).

Configuration and data files
cd ${FARMDIR}
tar -cvzf ${MOINBACKUP}/config-data-${MOINOLDVERSION}.tar.gz .
CGI and static files
cd ${WWWDIR}
for subdir in MOIN-WIKI-TEMPLATE ${MOINDOMAINS}
do
  tar -rvf ${MOINBACKUP}/cgi-static-${MOINOLDVERSION}.tar ${subdir}
done
# we do this in 2 steps, because you can't "tar -r"
# using a compressed tar file
gzip ${MOINBACKUP}/cgi-static-${MOINOLDVERSION}.tar
MoinMoin code
cd ${PYLIBPKG}
tar -cvzf ${MOINBACKUP}/moin-code-${MOINOLDVERSION}.tar.gz MoinMoin

Download and install new version

Check configuration

This is the only manual step. You have to manually check some files for upgrades. Hopefully, there will be very little to do.

  • Compare the files in ${SHARE}/htdocs with the files in ${WWWDIR}/MOIN-WIKI-TEMPLATE/wiki. If you didn't modify anything in the latter, just copy the former into the latter:
cp -R ${SHARE}/htdocs/* ${WWWDIR}/MOIN-WIKI-TEMPLATE/wiki
  • Review the provided farmconfig.py in ${SHARE}/config/wikifarm/farmconfig.py and see if you have something to change in your farmconfig.py in ${FARMDIR}/farmconfig.py. This can only be done manually.
  • Review the provided mywiki.py in ${SHARE}/config/wikifarm/mywiki.py and see if you have something to change in your template mywiki.py in ${FARMDIR}/TEMPLATES/mywiki.py and in every instance configuration file already created (these are some of the files in ${FARMDIR}/*/*.py). This can only be done manually.


Upgrade the data directories

  • Now you have to upgrade the data directories for every instance of the farm you have installed.
for domain in ${MOINDOMAINS}
do
  echo "MIGRATING ${domain}..."
  moin --config-dir=${FARMDIR} --wiki-url=${domain}/ migration data
  echo "${domain} READY."
done
  • check the output of the above commands for error messages... a normal output would be something like:
MIGRATING example.org...
Calling migration script for /home/inst/run/etc/moinfarm/example_org/data, base revision 1050400
Returned. New rev is 1050500.
Calling migration script for /home/inst/run/etc/moinfarm/example_org/data, base revision 1050500
Returned. New rev is 1050600.
Calling migration script for /home/inst/run/etc/moinfarm/example_org/data, base revision 1050600
Returned. New rev is 1050700.
Calling migration script for /home/inst/run/etc/moinfarm/example_org/data, base revision 1050700
Returned. New rev is 1050800.
Calling migration script for /home/inst/run/etc/moinfarm/example_org/data, base revision 1050800
Final mig script reached, migration is complete.
example.org READY.
MIGRATING example.com...
Calling migration script for /home/inst/run/etc/moinfarm/example_com/data, base revision 1050400
Returned. New rev is 1050500.
Calling migration script for /home/inst/run/etc/moinfarm/example_com/data, base revision 1050500
Returned. New rev is 1050600.
Calling migration script for /home/inst/run/etc/moinfarm/example_com/data, base revision 1050600
Returned. New rev is 1050700.
Calling migration script for /home/inst/run/etc/moinfarm/example_com/data, base revision 1050700
Returned. New rev is 1050800.
Calling migration script for /home/inst/run/etc/moinfarm/example_com/data, base revision 1050800
Final mig script reached, migration is complete.
example.com READY.
MIGRATING example.net...
Calling migration script for /home/inst/run/etc/moinfarm/example_net/data, base revision 1050400
Returned. New rev is 1050500.
Calling migration script for /home/inst/run/etc/moinfarm/example_net/data, base revision 1050500
Returned. New rev is 1050600.
Calling migration script for /home/inst/run/etc/moinfarm/example_net/data, base revision 1050600
Returned. New rev is 1050700.
Calling migration script for /home/inst/run/etc/moinfarm/example_net/data, base revision 1050700
Returned. New rev is 1050800.
Calling migration script for /home/inst/run/etc/moinfarm/example_net/data, base revision 1050800
Final mig script reached, migration is netplete.
example.net READY.

A Simple Walk-Through Installation

I wrote an straight forward MoinMoin installation walk-through at: http://blog.brettski.com/2009/11/21/install-moinmoin-on-dreamhost-walk-through/

It's a simple, step-by-step walk through to get a MoinMoin wiki up and running on a Dreamhost shared hosting account.

MoinMoin with Passenger wsgi

It's much easier to config MoinMoin on dreamhost now, since Passenger wsgi is now available.

Follow the usual installation according to what you want (wikifarm, or just stand-alone wiki). Just assume that you install moinmoin with 'prefix=$HOME'

Configure your domain with dreamhost

Go to "Manage Domains" and add a domain like wiki.yourdomain.org, and do not forget to check passenger support. Then you should get a new folder wiki.yourdomain,org with a subfolder 'public'.

Copy the different files

You should put the static file in public. There is different way to do for this. IMHO, the best is to keep the default path from MoinMoin, so create a folder 'moin_static192' (if you are running a 1.9.2 version) in the 'public' folder. Then copy the files from '$MOINMOIN_INSTALLATION/share/moin/htdocs' into this folder.

Another solution would be to use the symbolic link, but it can lead some bug with some Dreamhost configuration.

Write the passenger_wsgi.py

At the root of your domain directory, create a file : 'passenger_wsgi.py' and add this inside :

import sys, os

#The two following line ensure that you are using python2.4
#You can change it to another python version if you want
INTERP = "/usr/bin/python2.4"
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)

#If MoinMoin folder is in your PYPATH
#This is an example if you install MoinMoin with python2.4 in your $HOME
sys.path.insert(0, '/home/username/lib/python2.4/site-packages')

#Path to your $WIKI_CONFIG
sys.path.insert(0, '/home/username/wikifarm/config')

from MoinMoin.web.serving import make_application

#Import to set shared to False, to serve the media files directly
application = make_application(shared=False)

Troubleshot

If you get an error message about your underlay data, I advise you to add this following line to your config file :

data_dir = '/home/username/path/to/your/wiki/data'
data_underlay_dir = '/home/username/share/moin/underlay'

That's all, Folks!