Install MoinMoin in Debian

I have read some good things about MoinMoin and decided to give it a shot. Some of its features I like are: built using Python, stores data in files (not in database), and Debian has a package available.

Install Software

To install the software, run the following command:

sudo aptitude install python python-moinmoin apache2

After installation, some paths related to MoinMoin are as below:

Source code for MoinMoin is located at: /usr/lib/pymodules/python2.5/MoinMoin/
Templates for MoinMoin are located at: /usr/share/moin/
Config for your wikis is located at: /etc/moin/

Create Your First Wiki

I want to thank these pages for helping me write this section. You should read them in this order as well: Basic Installation; WikiInstanceCreation.

I installed my wiki in the /opt/wiki/ path. So I needed to create the directory.

sudo mkdir /opt/wiki/

Once the directory has been created, you need to copy over files from the MoinMoin templates.

cd /opt/wiki/
sudo cp -R /usr/share/moin/data/ /opt/wiki/
sudo cp -R /usr/share/moin/underlay/ /opt/wiki/
sudo cp /usr/share/moin/config/ /opt/wiki/
mkdir /opt/wiki/cgi-bin
cd /opt/wiki/cgi-bin/
cp /usr/share/moin/server/moin.cgi /opt/wiki/cgi-bin/

Since we installed in a location which is accessible to root by default only, we need to change its permissions. We change the owners: owned by user codeghar and owned by group www-data. www-data is the user and group under which Apache runs in Debian. This way I, as a user, and Apache, as a program, can edit files easily.

cd /opt/
sudo chown -R codeghar:www-data wiki
sudo chmod -R ug+rwx wiki
sudo chmod -R o-rwx wiki

The config for MoinMoin is stored in /etc/moin/. To install our first wiki, we need to make some changes.

cd /etc/moin/
sudo vim

Change the following settings in the file /etc/moin/

sitename = u'CodeGharWiki'
interwikiname = u'CodeGharWiki'
data_dir = '/opt/wiki/data/'
data_underlay_dir = '/opt/wiki/underlay/'
url_prefix_static = '/moin_static192' # here the value 192 depends on which version of MoinMoin you have installed. On my Debian Squeeze installation it was 1.9.2; hence, 192.

Configure Apache

Now you need to configure Apache to run your wiki. I want to thank Apache on Linux in helping with this section.

cd /etc/apache2/sites-available/
sudo vim wiki

Make sure the following exists in this file.

<VirtualHost *:80>
#comment the line below if you intend to use only http://localhost/mywiki
DocumentRoot /opt/wiki/
Alias /moin_static192/ "/usr/share/moin/htdocs/"
ScriptAlias /wiki "/opt/wiki/cgi-bin/moin.cgi"
<Directory /opt/wiki/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
Options +ExecCGI

Once you have created the file, you need to install the site in Apache by running the following commands.

sudo a2ensite /etc/apache2/sites-available/wiki
sudo /etc/init.d/apache2 reload

Browse Your Wiki

Everything should be installed and ready to go. Just point your browser to (or whatever your website is) and enjoy.

Hat tips: MoinMoin; Help on Installing.


3 Responses to Install MoinMoin in Debian

  1. Pingback: Install MoinMoin in Debian | - Your one stop for news about Debian

  2. GiacFede says:

    thankyou for this post.

    there is an error in this command: a2ensite /etc/apache2/sites-available/wiki!

    In my debian squeeze dist I have this error: No site found matching /etc/apache2/sites-available/wiki!

    because the right command is: a2ensite wiki


  3. Pingback: Joe Martel

%d bloggers like this: