Contents
Debian Installation - HowTo
The /usr/share/doc/python-moinmoin/README.Debian.gz file should be consulted for the official package's instructions.
See bottom for apache2 and mod_python. The debian version of this is very easy to get and setup. However, for a first time user there are quite a few steps that you might find a touch tricky. For experts all you need to do is:
1. install apache
2. configure the apache web server to point to the MoinMoin code
3. install the moinmoin package
4. configure the moinmoin package
5. restart apache
For those of you reading this that aren't experts, here is a guided setup of the MoinMoin package.
Install the Packages
Just type one of the following:
aptitude install python-moinmoin
or...
apt-get install python-moinmoin
And a few seconds after, you're done. Then you need to actually configure it. You will need to setup apache and your wiki instances. You can find the debian documentation on how to do the rest of the installation in /usr/share/doc/python-moinmoin/README.Debian.gz.
If you can't be bothered reading this file it says the following:
# mkdir -p /var/www/mywiki # mkdir -p /var/lib/mywiki # cp -r /usr/share/moin/data /usr/share/moin/underlay /var/lib/mywiki # chown -R www-data: /var/lib/mywiki /var/www/mywiki
Change all occurences of mywiki into name of your choice. Be careful! You have to be very consistent in naming. Every mistake can cause failure. Pay attention to the copy command. You want to copy data and underlay into /var/lib/mywiki, so there may not be any trailing slashes!
Configure Apache
The configuration directives that allow Moin to work with Apache 2 (provided by Debian) are as follows:
Alias /moin_staticxxx/ "/usr/share/moin/htdocs/" ScriptAlias /MyWiki "/usr/share/moin/server/moin.cgi/"
These directives are typically placed in a file of your choosing in the /etc/apache2/sites-available directory. For example, /etc/apache2/sites-available/mywiki.
In the Alias directive, replace xxx with 194, for wheezy, or 193, for squeeze, or 185 for lenny. To be sure, read the version info by executing the following at the command line:
moin --version
If you are using default Apache2 installation, you can place the above directives inside the <VirtualHost> directive in /etc/apache2/sites-enabled/000-default instead of creating a new site file. If you want to deploy Moin in another existing virtual host in your installation, place the above directives inside the <VirtualHost> directive in the appropriate file.
Restart the Apache Web Server with the following command:
service apache2 restart
On older Debian versions, use this:
/etc/init.d/apache2 restart
Question: Why is /moin_staticXXX used and not /wiki any more?
Because users confused that static URL and the wiki script URL all the time as long as we had that /wiki URL for the static stuff.
Configure MoinMoin Instance
Now you have to go and configure your MoinMoin instance. You do that by editing the file /etc/moin/farmconfig.py
Then copy mywiki.py (already provided by Debian) to backup copy:
- # cp /etc/moin/mywiki.py /etc/moin/mywiki.py.original
first we have to edit /etc/moin/farmconfig.py:
- Change name of wiki from mywiki to whatever you want (or leave it as mywiki if you used mywiki in the statements above)
then edit /etc/moin/mywiki.py (or whatever you named it before)
- Change sitename and wikiname to your wiki's name
- Change datadir to data_dir = '/var/lib/mywiki/data'
- Change data underlay dir to data_underlay_dir = '/var/lib/mywiki/underlay'
surf to http://localhost/MyWiki - you should have it working
Also, if you have been so bold as to play with unofficial or older testing/unstable packages then beware that you also need to do the migration yourself (there is no way the package can guess where and how you set up your instances).
Current Versions Available
See MoinMoin's page in the package tracking system for the current package version.
For more info, see:
DebianUpgrade, how to upgrade your existing Debian Moin (if you cannot follow the short documentation in README.Debian in the package).
HelpOnUpdating, on general instructions for any Moin upgrade protocol.
Enjoy...
Problems with Lenny
I did a fresh install of moinmoin 171 in Debian lenny (stable) and I got this error
AttributeError: module '/var/lib/python-support/python2.5/MoinMoin/request/__init__.pyc' contains no 'RequestModPy'
To put moinmoin to work I followed the below from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477491
I was able to get it working by changing a line in my apache configuration from: PythonHandler MoinMoin.request::RequestModPy.run to: PythonHandler MoinMoin.request.request_modpython::Request.run I also needed to change an alias to get css working from: Alias /wiki /usr/share/moin/htdocs to: Alias /moin_static171 /usr/share/moin/htdocs
More Problems with Lenny
Package: python-moinmoin Version: 1.7.1-3+lenny5
/etc/moin/farmconfig.py & /etc/moin/mywiki.py Are installed with incorrect permissions causing the following error when following these instructions:
ImportError: No module named wikiconfig Check that the file is in the same directory as the server script. If it is not, you must add the path of the directory where the file is located to the python path in the server script. See the comments at the top of the server script. Check that the configuration file name is either "wikiconfig.py" or the module name specified in the wikis list in farmconfig.py. Note that the module name does not include the ".py" suffix. Error in your configuration file "/var/lib/python-support/python2.5/MoinMoin/config/multiconfig.py" around line 45.
Solution: chmod 644 /etc/moin/*
See bug report for more info: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601733
Some comments:
- 1.7.1 is not quite "fresh". think about using some more recent package or just using the download version.
- don't use mod_python, rather use mod_wsgi - it is much better
- the Alias should be /moin_static171 (for moin 1.7.1)