Contents
Ubuntu Lucid Installation - HowTo
This page describes how to install MoinMoin with mod_wsgi and apache2 using packages only in Ubuntu 10.04 LTS Lucid Lynx. It assumes you have root access to the system and want to use Apache Name-Based VirtualHosts to create a wiki at the root of a domain (ie wiki.example.org). The package has farmconfig enabled by default, and therefore its used instead of wikiconfig.py.
You can find the package documentation for MoinMoin here:
/usr/share/doc/python-moinmoin/README.Debian.gz
To view:
zcat /usr/share/doc/python-moinmoin/README.Debian.gz | less
Create a MoinMoin User
For security the MoinMoin application can be ran as a different user than Apache (www-data). To create a system user and group for this purpose:
sudo adduser moin --system --group
The group flag creates a user group of the same name and places the user within it. The system flag is an instruction to create a non-shell user.
Install the Packages
Type:
sudo apt-get install python-moinmoin apache2 libapache2-mod-wsgi
Additional Configuration
This is an arbitrary convenient folder to store the data for each wiki instance:
sudo mkdir /srv/moin
You could also use the moin user's home directory.
Make the underlay folder available to the MoinMoin user:
chown -R moin:moin /usr/share/moin/underlay
Copy Wiki Instance Files
Substitute 'mywiki' with a different name for each wiki to want to create:
sudo mkdir /srv/moin/mywiki sudo cp -r /usr/share/moin/data /usr/share/moin/underlay /srv/moin/mywiki
Fix security:
sudo chown -R moin:moin /srv/moin/mywiki #Making Folder Available to MoinMoin sudo chmod -R ug+rwX /srv/moin/mywiki sudo chmod -R o-rwx /srv/moin/mywiki
Configure Apache
Configure the MoinMoin WSGI Driver
Place the following in /etc/apache2/conf.d/moin.conf
WSGIDaemonProcess moin user=moin group=moin processes=5 threads=10 maximum-requests=1000 umask=0007 WSGIProcessGroup moin
Create the VirtualHosts
Place the following in /etc/apache2/sites-available/mywiki, substituting your wiki name for 'mywiki'. Repeat for each wiki you're creating:
<VirtualHost *:80> ServerName wiki.example.org DocumentRoot /srv/moin/mywiki/ WSGIScriptAlias / "/usr/share/moin/server/moin.wsgi" </VirtualHost>
Note: make sure the line 'sys.path.insert(0, '/etc/moin')' is uncommented in moin.wsgi
Enable site and restart apache:
sudo a2ensite mywiki sudo /etc/init.d/apache2 restart
Configure MoinMoin
Configure farmconfig.py
Open /etc/moin/farmconfig.py for editing and add your url information as indicated by the example lines:
("wiki1", r"^http?://wiki1\.example\.org/.*$"),
Uncomment this line and change it too:
superuser = [u"WikiAdmin", ]
Also add this line at the end of the file:
data_underlay_dir = '/usr/share/moin/underlay/'
Configure Instance
Make a backup of the provided config:
cp /etc/moin/mywiki.py /etc/moin/mywiki.py.original
Then open /etc/moin/mywiki.py for editing and save it as the wiki name that you picked after changing these lines:
sitename = u'MyWiki' # [Unicode] interwikiname = u'MyWiki' # [Unicode] data_dir = '/srv/moin/mywiki/data/'
Language Setup
Visit your new wiki here; http://wiki.example.org/LanguageSetup follow the instructions and create accounts for the Superuser and yourself.
Optional Configurations
Have Apache Serve Static Files
In /etc/apache2/conf.d/moin.conf add:
Alias /moin_static192 "/usr/share/moin/htdocs/"
The line 'Alias /moin_static192 "/usr/share/moin/htdocs/"' will need to be adjusted if the version of MoinMoin installed changes.
Access Control
Private Wiki
in /etc/moin/mywiki.py:
acl_rights_default = u'WikiAdmin:read,write,delete,revert,admin YourName:read,write,delete,revert All:'
Blocking New Accounts
After creating the Superuser account and any others you need; in /etc/moin/mywiki.py:
actions_excluded = FarmConfig.actions_excluded + ['newaccount']
Using a Alternate Document Root
In the VirtualHost directive for you site add something like;
WSGIScriptAlias /wiki "/usr/share/moin/server/moin.wsgi"
In /etc/moin/farmconfig.pyadd something like;
("wiki",r"^http://example\.org/wiki.*$"),
References
Setup information, including details on Apache Virtual Hosts
Package website for Ubuntu Lucid Lynx
Community Documentation on MoinMoin from Ubuntu