Basic Installation
Before you can integrate MoinMoin into your web environment, you have to do the basic installation of the MoinMoin code and data files using the standard Python distutils mechanism (setup.py). We'll explain the usual steps you need to take to do this. For more details on the distutils installation process, consult the
Installing Python Modules document of your Python manual.
The installation is quite similar on Linux (or other POSIX type systems, for simplicity, we will just talk of Linux in the docs) and Windows.
We use the syntax > command arguments to show what you have to type in on a command prompt (shell). In our examples "> " is the prompt, you don't have to type it in.
Check if Python is working
If you have shell access, simply type:
> python -V Python 2.3.4
Without shell access, you can try using this pythontest.cgi script (upload it to your cgi-bin directory, use chmod a+rx pythontest.cgi to make it executable and invoke it using your web browser). It assumes a Linux/UNIX type web server:
#!/bin/sh echo Content-Type: text/plain echo echo "CGI scripts work" echo "Now we try to invoke python interpreters and get their versions:" python -V python2 -V python2.0 -V python2.1 -V python2.2 -V python2.3 -V python2.4 -V echo "Finished."
If this doesn't show "CGI scripts work", well, then CGI scripts don't work.
If it doesn't show one or more Python version numbers, you don't have Python installed (or it is not in the search path). Fix that before proceeding as moin won't run without a working python.
Also consult the file CHANGES in moin archive and see if your Python version meets the minimum requirement.
Downloading
To download the distribution archive, go to the
download area and fetch the lastest archive.
Unpacking
The first step is to unpack the distribution archive, which you have done already when you loaded this instructions from your disk. If you read this on the web, the distribution comes in a versioned ZIP or TAR archive, which you can unpack as shown below.
The distribution archive will always unpack into a directory named moin-<version>, for example moin-1.3.
Unpack it and enter the directory with the moin files:
> tar xzf moin-1.3.tar.gz # on windows, you can use WinZip to extract .tar.gz archives, or gnutar and gzip for windows. > cd moin-1.3
Installation
You can install moin to either:
system locations (if you have the necessary rights to do that - on Linux you need to be root for that), or to
some specific location like your home directory (Linux) or C:\moin (Windows).
The installation to systems location is easier, so choose that, if possible.
If you have different Python versions installed, please use the same version for setup as you want to use later for running the wiki. Usually, the latest Python version will get the best results.
Linux: If you have problems with the setup.py install step, note that you need to have the Python development package installed separately on some Linux distributions. On Mandrake, you need to "rpm -i python-devel-2.x.x-xmdk.i586.rpm".
Installation to default system location
> python setup.py --quiet install --record=install.log
This installs moin to system locations (like the Python directory, on Linux: /usr/lib/..., /usr/share/...), see install.log about which files where installed.
Installation to home directory or other specific location
We use $HOME (Linux) or C:\moin (Win32) in our example:
# Linux: > python setup.py --quiet install --prefix=$HOME --record=install.log # Windows: > python setup.py --quiet install --prefix=C:\moin --record=install.log
All moin files will then be created below that directory, see install.log about which files where installed.
You will likely see the following warning:
warning: install: modules installed to 'C:\moin\', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself
This means exactly what it says, you need to add your install directory to the search path of Python or it won't find the MoinMoin code:
E.g., if you are running using a webserver and standard CGI, edit moin.cgi and directly add your installation directory to the python path, like this:
import sys
sys.path.append('C:/moin')
What you have now
It is important that you understand the different locations used in a MoinMoin setup, so read this carefully:
Look into install.log to find out about following important locations:
MoinMoin directory, usually PREFIX/lib/pythonX.X/site-packages/MoinMoin - this is where the MoinMoin code is located
share directory, usually PREFIX/share/moin - this is where templates are located for:
data directory (wiki pages, users, etc.) - this is only accessed by the wiki code
underlay directory (wiki pages, users, etc.) - this is only accessed by the wiki code
htdocs directory with themes (images and CSS) etc. - stuff directly accessed by the web server
server - moin startup files (like moin.cgi for CGI and other stuff for other startup methods)
config - wiki configuration files (like wikiconfig.py)
bin directory with some stubs to invoke some moin shell commands
We talk of templates because you usually don't use those files at that location, but keep them unmodified at that location (to setup additional wikis later and have easy version upgrades).
PREFIX is what you gave to the setup.py command or default locations when you didn't use the --prefix option.