Problems setting up MoinMoin on Debian Wheezy

1.5k Views Asked by At

I have problems setting up a single MoinMoin wiki on Debian Wheezy. What I want is a wiki at localhost/MyWiki (actually I don't care where it is exactly). I followed three different installation guides: The official README.Debian of the Debian package, the MoinMoin Installation Guide for Debian and Oz123's install notes, all to no avail.

Here are my setup notes (sorry for the length but since the configuration is not trivial, I thought I'd better be specific):

1) Create and populate /var/www/mywiki:

# mkdir /var/www/mywiki
# mkdir /var/lib/mywiki
# cp -r /usr/share/moin/data /usr/share/moin/underlay /var/lib/mywiki

2) Pass on the wiki to Apache:

# chown -R www-data: /var/www/mywiki /var/lib/mywiki

3) Configure Apache2:

Add the following as /etc/apache2/sites-available/mywiki:

<VirtualHost *:80>
    # NOTE: I changed the server name "wiki.example.org" to:
    ServerName localhost
    DocumentRoot /var/www/mywiki/
    Alias /moin_static194/applets/FCKeditor/ "/usr/share/fckeditor/"
    Alias /moin_static194/ "/usr/share/moin/htdocs/"
    ScriptAlias /MyWiki "/usr/share/moin/server/moin.cgi"
</VirtualHost>

4) Configure MoinMoin:

Edit /etc/moin/mywiki.py to include these lines (NOTE: After installing python-moinmoin, /etc/moin did not contain a file named mywiki.py, so I search-copied it first:

# cp $(find /usr/share/moin/ | grep -E "/mywiki\.py$") /etc/moin/

Then I added/changed the file to include the following lines:

    sitename = u'MyWiki' # [Unicode]
    data_dir = '/var/lib/mywiki/data'
    data_underlay_dir = '/var/lib/mywiki/underlay'
    superuser = [u"YourName", ]

Then I appended www-data localhost to /etc/moin/wikilist:

echo "www-data localhost" > /etc/moin/wikilist

5) Activate wiki:

# a2ensite mywiki
# service apache2 reload

6) Visit your new wiki at http://your.site/MyWiki/LanguageSetup then create you account (name according to the superuser you specified above).

However, visiting http://localhost/MyWiki/LanguageSetup gave the following error:

ConfigurationError

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.

So I search for wikiconfig.py:

# find /usr/share/moin/ | grep -E "/wikiconfig\.py$"
... /usr/share/moin/config/wikiconfig.py

Reading through wikiconfig.py, I found out that this file should reside in the same dir as data/ and underlay/. Since I copied both dir's to /var/lib/mywiki in step 1), I copied this script there as well:

# cp $(find /usr/share/moin/ | grep -E "/wikiconfig\.py$") /var/lib/mywiki

I also changed sitename = u'Untitled Wiki' to sitename = u'MyWiki' to match with the configuration in mywiki.py (step 4). Still, visiting http://localhost/MyWiki/LanguageSetup gave another error:

ConfigurationError

data_dir "/usr/share/moin/server/data" does not exist, or has incorrect ownership or
permissions.

Make sure the directory and the subdirectory "pages" are owned by the web
server and are readable, writable and executable by the web server user and
group.

It is recommended to use absolute paths and not relative paths. Check
also the spelling of the directory name.

Why is the script trying to find data in /usr/share/moin/server/data and not in /var/lib/mywiki/data as I configured it in mywiki.py (cf. step 4)? Having tried getting MoinMoin to run more times thant I care to admit, I wondered whether maybe one of you guys can point out the obvious error in my ways ...

1

There are 1 best solutions below

0
On

you seem to want to do it the debian package way:

install the debian package (apt-get install python-moinmoin or so)

then the wiki farm configs are in /etc/moin/*.py because debian puts them there - carefully edit them, but do not remove the farmconfig.py (because the debian setup IS a wiki farm configuration, you can start with 1 wiki and later add more wikis).

debian should have adaptor scripts (like moin.cgi or moin.wsgi) that insert '/etc/moin' into sys.path (sys.path is where python search for code) - check this, the error message you get says it doesn't find wikiconfig.py (which is the second thing it tries after failing to find farmconfig.py)

your impression that wikiconfig.py must be in same dir as data and underlay is wrong. it just needs to be in a directory in sys.path.

btw, if you don't do it the debian way and don't use apache for your first moin steps, you can just download the archive from http://moinmo.in/, unpack it and run ./wikiserver.py and it'll just work.