Quick MoinMoin on FreeBSD

A quick guide for setting up your first MoinMoin Wiki on FreeBSD.

About this HowTo

MoinMoin versions
1.9.6
Platforms
FreeBSD 9.1-RELEASE

This guide will show you step by step the manual installation of a single MoinMoin Wiki under FreeBSD. It is simple and quick, but it also tries to explain the reason of why you have to execute every step. In the end of this guide, you will have a functional MoinMoin Wiki running on your system. Have fun ;-)

NOTE: This tutorial does not work on FreeBSD 10.2 Release. The instructions repeated exactly from this tutorial leads to 403 errors.

1. Installation

MoinMoin is written in the Python programming language. Specifically, the current version is written in Python 2.x. MoinMoin is actually a WSGI-compatible Python web application. So, in order to execute MoinMoin, we need an HTTP server that knows WSGI. For this reason we will use the popular Apache HTTP server along with the wsgi_module that is the best Python WSGI adapter module for Apache. I could characterize this setup as production-ready for a small Wiki.

1.1. Requirements

The software packages that we have to install (or ensure that we have installed) are:

1.1.1. Python

Ensure that Python 2.7 is installed (probably it is):

pkg info lang/python27

If it is not installed, install from Ports with:

cd /usr/ports/lang/python27
make config-recursive
make install clean

1.1.2. Apache HTTP Server

Ensure that Apache HTTP Server 2.2 is installed:

pkg info www/apache22

If it is not installed, install from Ports with:

cd /usr/ports/www/apache22
make config-recursive
make install clean

When configuring, please make sure that the THREADS option is selected. This option is needed from the mod_wsgi module for its daemon mode.

1.1.3. Apache Module WSGI

Ensure that mod_wsgi is installed:

pkg info www/mod_wsgi2

If it is not installed, install from Ports with:

cd /usr/ports/www/mod_wsgi2
make config-recursive
make install clean

1.2. MoinMoin Installation

Now we proceed to the installation of MoinMoin. We use the MoinMoin port for that:

cd /usr/ports/www/moinmoin
make config-recursive
make install

Please do not clean after installing as we will use it to create our wiki instance.

We are finished with installing software packages. We continue with the configuration.

2. Configuration

We will make any necessary configurations in order to get our first MoinMoin Wiki up and running.

2.1. Creating a Wiki instance

Step into the MoinMoin port and create your first MoinMoin Wiki instance.

cd /usr/ports/www/moinmoin
make MOINTYPE=WSGI instance

A MoinMoin Wiki instance has been created under /usr/local/www/wiki.

2.2. Apache HTTP Server

All the configuration of the Apache HTTP Server will be done using the httpd.conf file. Please open it in your favorite text editor.

vim /usr/local/etc/apache22/httpd.conf

First, make sure that Apache can load the WSGI module. Search for the following line, and if it doesn't exist, add it.

LoadModule wsgi_module libexec/apache22/mod_wsgi.so

Now, navigate to the end of the file, and add the following information that instruct the Apache HTTP Server to:

Alias /moin_static194/ "/usr/local/lib/python2.7/site-packages/MoinMoin/web/static/htdocs/"

<Directory "/usr/local/lib/python2.7/site-packages/MoinMoin/web/static/htdocs/">
     Order deny,allow
     Allow from all
</Directory>

WSGIScriptAlias /mywiki "/usr/local/www/wiki/moin.wsgi"

<Directory "/usr/local/www/wiki/">
     Order deny,allow
     Allow from all
</Directory>

WSGIDaemonProcess moin processes=5 threads=10 maximum-requests=1000
WSGIProcessGroup moin

3. Execution

Fire up your favorite Internet browser and type the URL:

http://localhost/mywiki

You can see the Welcome page of MoinMoin. You can follow the instructions there for further configuration.

Congratulations! Your first MoinMoin Wiki is waiting for you!

MoinMoin: HowTo/FreeBSDQuick (last edited 2015-10-08 14:49:56 by 68)