This HTML page contains the basic install docs that can be found on http://moinmaster.wikiwikiweb.de/MoinMoin/InstallDocs. It contains all necessary information to get your wiki up and running, even without being online. If you have a permanent internet connection, you might want to browse the docs on the HelpOnInstalling page, which might contain more up-to-date information.

After following the procedures on this page, you should have a working wiki and can browse the rest of the online docs there.

How to install your own MoinMoin Wiki

This page describes the installation procedure of MoinMoin. In the next section, there is a list of real-world Installation Scenarios that help you to understand how to apply the instructions in different environments. If you already have a wiki running and want to upgrade, see HelpOnUpdating.

A MoinMoin installation is done by some elementary steps:

  • Basic Installation explains the "setup.py" step of the installation in more detail. This is uses to get the MoinMoin code and wiki template installed onto your system. This applies equally to all scenarios, and you should read it before trying a live installation.

  • Wiki Instance Creation explains how you make a new wiki instance (data and configuration), this is also common to all scenarios.

  • Getting the web server to serve static stuff under the /wiki URL (url_prefix) - used for theme CSS and images, etc. - this is slightly different for the various web servers that can be used - see below.

  • Getting the web server to execute the moin code when you access wiki pages. This is done either by CGI, FastCGI, mod_python or Twisted or the built-in stand alone server - this is slightly different for the various web servers that can be used - see below.

  • After a successful installation, you might want to read more about configuration and other options that you, as the wiki administrator, can set up. HelpOnAdministration contains links to pages that cover these topics. Especially, the HelpOnConfiguration and HelpOnUpdating pages provide additional information regarding wiki setup and maintenance.

  • Trouble-shooting helps with fixing any general problems you might encounter, which apply to any installation platform.

Installation steps specific for some web servers and operating systems

The following links will show you concrete examples of installation sessions, showing the commands used and explaining what they do. You must first read the general information on installing above before doing the installation steps described on the pages linked from below:

Linux:

Long-Running-Process Setup:

Mac OS X:

Windows:

How to do a basic installation of MoinMoin on your system.

Contents

  1. Check if Python is working
  2. Download MoinMoin
  3. Install MoinMoin
    1. Installing in the default system location
    2. Installing in the home directory or another specific location
  4. Test installation
  5. What has been installed

Before you can integrate MoinMoin into your web environment, you have to install the MoinMoin source code and data files using the standard Python distutils mechanism (setup.py). This page explains the steps you usually need to take to do this. For more details on the distutils installation process, consult the Installing Python Modules document in your Python documentation set.

The installation is similar on Windows and Linux (and other POSIX-type systems; for simplicity, we just say "Linux" in the docs).

  • (!) We use text such as > command arguments to show what you have to type at the command prompt (also known as shell, terminal, etc.). In our examples "" is the prompt, you don't have to type it in, you have to type what comes after it. Lines that do not begin with "" are the answers to the commands you have typed. Read them carefully.

Check if Python is working

MoinMoin needs Python to run, so the first step is to check if an usable version of Python is installed and correctly set-up. If this is not the case, you will have to fix that before you can proceed.

The CHANGES file in the MoinMoin archive mentions what versions are supported. Python 2.3 is the minimum requirement for MoinMoin 1.5, but we suggest you use the latest Python release version.

You can download Python at http://www.python.org/download/.

If you are pretty sure an acceptable version of Python is installed but the commands below do not work, this may be because your Python files are not in the search path. Correctly setting the search path is outside the scope of this document; please ask for help on your favorite Python, Linux, or Windows discussion board.

If you have shell access, checking if Python is working is very simple. Just type the following command, and look at the result:

> python -V
Python 2.3.4

If you don't have shell access, you can try using this pythontest.cgi script (it assumes that you are using a Linux kind of webserver). Upload the script to your cgi-bin directory, use chmod a+rx pythontest.cgi (or a similar command in your FTP program) to make it executable, and invoke it using your web browser.

#!/bin/sh
echo Content-Type: text/plain
echo
echo "Your web server is running as:"
id
echo "CGI scripts work"
echo "Now we try to invoke Python interpreters and get their versions:"
echo "Your default version of python is:"
python -V 2>&1
echo 
echo "Available versions of python are:"
python2.2 -V 2>&1 && which python2.2
python2.3 -V 2>&1 && which python2.3
python2.4 -V 2>&1 && which python2.4
python2.5 -V 2>&1 && which python2.5
echo "Finished."

pythontest.cgi

If it doesn't display "CGI scripts work", well, then CGI scripts don't work. If it doesn't show one or more Python version numbers, then Python is not correctly installed. In both cases, before you can proceed, you will have to get in touch with the administrator of the server so that the problems get corrected.

Also be sure to read ../ApacheOnLinuxFtp after you've completed the ../BasicInstallation illustrated here.

Download MoinMoin

To download the distribution archive, go to the download area and fetch the latest archive.

The next step is to unpack the distribution archive (which you have done already if you are reading this text from your hard drive). If you read this on the web, the distribution comes in a versioned .tar.gz archive, which you can unpack as shown below.

  • On Windows

    • You can use recent versions of programs like WinZip, WinRar, and WinAce, which handle .tar.gz kind of archives.

    • At the command prompt, you can use GNU gzip and GNU tar for Windows.

  • On Linux

    • You can use your favorite file manager -- it should be able to unpack them.

    • At any shell prompt, you can use the tar command.

The distribution archive will always unpack into a directory named moin-<version>, for example moin-1.5.

Here is how you would unpack the archive (using GNU tar) and enter the directory with the MoinMoin files:

> tar xzf moin-1.5.0.tar.gz
> cd moin-1.5.0

Install MoinMoin

You can install MoinMoin to either:

  • a system location (if you have the necessary rights to do that -- on Linux you need to be root)

  • some specific location, like your home directory (Linux) or C:\moin (Windows).

The installation to a system location is easier, so choose that if possible.

/!\ If you have several versions of Python installed, please use the same version for setup and for running the wiki. Usually, the latest Python version will get the best results.

If you have problems with the setup.py install step, try using the command:

> python -v setup.py --quiet install --record=install.log

The additional -v flag should provide you detailed verbose messages every step of the way.

/!\ On Linux, if u get an error like Invalid Python installation: cannot find /usr/lib/Python2.x/config/Makefile, you may not have the python module distutils installed, it's usually a part of the Python development libarary (python-dev). Some Linux distributions may not have installed it by default. For example, on Mandrake you need to install the python-devel package, on Debian it's called python-dev.

Installing in the default system location

> python setup.py --quiet install --record=install.log

This installs MoinMoin to the default system location (typically the Python directory, for example on Linux, inside /usr/lib and /usr/share). Look at the install.log file to see what was installed, and where.

  • Mac OS X note: use the command:

    python setup.py install --install-data='/usr/local'
    

    This will install the shared files to '/usr/local/share/moin', instead of an inconvenient location in the System folder.

Installing in the home directory or another specific location

Linux example, installing in the home directory:

> python setup.py --quiet install --prefix=$HOME --record=install.log

Windows example, installing in the C:\moin directory:

> python setup.py --quiet install --prefix="C:\moin" --record=install.log

All MoinMoin files will then be installed inside those directories, see install.log to know which files were installed, and where.

Note: 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.

For example, if you are running using a webserver and standard CGI, edit moin.cgi and add your installation directory to the Python path, like this:

import sys
sys.path.insert(0, 'C:/moin')

Test installation

As a final step, if you have access to the shell or the command prompt, you can check that everything is correctly installed and ready to run. Start Python and type import MoinMoin. Nothing should be displayed in response to this command. Example:

> python
Python 2.3.4 (#1, May 29 2004, 17:05:23)
[GCC 3.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MoinMoin
>>>

If you get this instead:

>>> import MoinMoin
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named MoinMoin
>>>

then you have to tune your installation. Try modifying sys.path, as described above.

What has been installed

So, you have a ready-to-work MoinMoin installation now. Congratulations! Before you go on to configuring it, take a look at the various files and directories that have been installed.

/!\ It is important that you understand the different locations used in a MoinMoin setup, so read this carefully.

In the following descriptions, PREFIX is what you used with the setup.py command, or a default location if you didn't use the --prefix option. (Typical default values on Linux are /usr and /usr/local.) X.Y is the version of Python. Typically, this is 2.3 or 2.4.

Look into install.log to find out about following important locations:

  • MoinMoin directory, usually PREFIX/lib/pythonX.Y/site-packages/MoinMoin -- this is where the MoinMoin source code is located

  • share directory, usually PREFIX/share/moin - this is where the templates are located

    • data directory (wiki pages, users, etc.) - only MoinMoin should access this

    • underlay directory (wiki pages) - only MoinMoin should access this

    • htdocs directory with html support files (images for the various themes, etc.) - the web server will need to access this

    • server - MoinMoin example startup files (like moin.cgi for CGI, and other files for other startup methods)

    • config - MoinMoin example configuration files (like wikiconfig.py)

  • bin directory with some scripts that help you use the MoinMoin shell commands

We talk of templates in the share directory because you usually will not use those files at that location, but copy them elsewhere when you need them. This way, you can set-up several wikis without problems, and easily upgrade to new MoinMoin versions.


After you have downloaded and installed MoinMoin, you will want to "have a wiki". As explained at the bottom of ../BasicInstallation, you have to copy several directories and files. This way, you can have as many wikis as you want, and you can easily upgrade MoinMoin: only the original files will be overwritten, not your copies.

Every time you copy those files (and modify the configuration of your server accordingly), you create what is called a wiki instance. Each wiki instance is independant from the others, with a different configuration, different pages, different users, etc.

Some of the steps you need to take depend on which web server and which operating system you use. They are described on dedicated pages, which you should read (at least the beginning) before reading this one. Some other steps are common to every webserver and operating system (copying files around, setting permissions), and this is what is described here.

Read this first

Security warnings

/!\ Warning: make sure that your data directory and your configuration files are not accessible through your web server. Do not put your wiki directory in public_html, Sites or any other directory your web server can access. The web server only needs to access the file in the htdocs directory and the moin.cgi script! (Or whatever script your server uses to start MoinMoin.)

/!\ Warning: make sure that the data directory and its subdirectories are not readable and not writeable by users other than the web server user. If you need to give worldwide read-write permissions to get it working, be aware that you are doing a very unsecure setup, that can be compromised by any other user or program on your computer.

Note to Windows users

All the commands below are Linux commands. The text descriptions that introduce them should be enough to help you understand what you need to do. Use the Windows Explorer, or the appropriate text-mode commands.

Choose a wiki name

Choose a unique name for the new wiki instance you want to create. It should be a short word, something that reflects what you intend to use the wiki for, like the name of your organization, of your team, of the project you are working on, etc.

  • <!> Do not use the name "wiki" - it is reserved for internal use. You would need a special setup to use this with CGI, and you can't use it at all with standalone or twisted server.

The name "mywiki" is used as an example in the various commands below.

Choose a location

Choose a directory on your disk, it will contain all the files needed for your wiki instance. At the beginning, your wiki instance will use approximately 10 MB of disk space. Then of course, it will grow depending on the way your wiki is used. A personal wiki, even with many pages, might only use 30 MB or 40 MB of disk space. A popular wiki, or a wiki with many files attached to the pages, might use much more, of course.

If you are the administrator (or root) of the server, you can use anything you like or that makes sense to you, for example /usr/local/var/moin, /mnt/wikis, etc.

If you are a simple user, you will probably only be allowed to write in your personal, "home" directory. Choose a subdirectory that makes sense to you, for example the share/moin subdirectory.

Collect some important information

This is where the instructions differ according to the web server and operating system you use, and whether you are the administrator or a simple user. See the appropriate pages for your web server and operating system combination.

On Linux, the export command will be used to remember the collected information. Windows users should write it down carefully (maybe cutting-and-pasting in a Notepad window), or store it in environment variables if they use the command prompt.

  • PREFIX is the prefix you used during the ../BasicInstallation

  • SHARE is the name of the share directory, as discussed at the bottom of ../BasicInstallation

  • WIKILOCATION is the name of the directory that will contain your wiki instance

If you are an administrator, you also need to collect the following:

  • USER is the user name of the web server

  • GROUP is the name of the group to which the web server belongs

Now, Linux folks, let's store these settings in memory:

> export PREFIX=/usr                # this might be something else
> export SHARE=$PREFIX/share/moin   # this should be correct for most people
> export WIKILOCATION=$SHARE        # this is just an example
> export INSTANCE=mywiki            # this is just an example

Administrators also need the following two lines:

> export USER=www-data              # this is just an example
> export GROUP=www-data             # this is just an example

Copy the files

To create your new instance, you first need to create a directory named like your instance, inside the WIKILOCATION. Then you need to copy the data and underlay directories from your SHARE directory into your instance directory. Finally, you need to copy the wikiconfig.py file from the config directory into the instance directory.

Linux folks need just type these commands:

> cd $WIKILOCATION
> mkdir $INSTANCE                   # make a directory for this instance
> cp -R $SHARE/data $INSTANCE       # copy template data directory
> cp -R $SHARE/underlay $INSTANCE   # copy underlay data directory
> cp $SHARE/config/wikiconfig.py $INSTANCE   # copy wiki configuration sample file
  • /!\ Note that you just need to keep one underlay directory on your system if you are running multiple wikis (e.g. in a farm.)

Set permissions

Administrators

Administrators need to restrict the permissions of the files, so that only the web server (and the administrator of course) can read and write them. For maximum security, no other user on the machine should be able to read or write anything in the wiki instance directory. Don't forget that this directory contains sensitive information, notably the (encrypted) passwords of the wiki users.

On Linux, the following commands should be enough:

> chown -R $USER.$GROUP $INSTANCE   # check that USER and GROUP are correct
> chmod -R ug+rwX $INSTANCE         # USER.GROUP may read and write
> chmod -R o-rwx $INSTANCE          # everybody else is rejected

Normal users

Normal users, on the contrary, need to broaden the permissions of the files, so that the web server can read and write them. On recent Windows versions, and on some versions of Unix, Linux and other systems, access control lists can be used to that effect. They are, however, powerful and complicated, much beyond the scope of this document. Ask a knowledgeable person about them.

Without them, normal users have to allow everybody to access the instance directory. This is the only way the web server can enter it and do its work. This is, of course, VERY INSECURE, since any other user and program on the server can read the directory. You should not use such a setup for a wiki open to the public.

On Linux, the following commands will open the instance directory to the whole world:

> chmod -R a+rwX $INSTANCE

Note:

  • it is also possible to put the web server and the normal user in the same group, and then only open the instance directory to the members of that group. This is a bit more secure (depending on who else is in the group), but you need the cooperation of the server administrator; he is the one setting up groups.

  • the best other possibility is that the server administrator sets up suexec to execute CGI scripts in user directories under the user id of that user. You don't need to give world permissions that way, so it is a quite secure setup, but you also need cooperation of the administrator.

Tune configuration

Now, you need to tune the configuration of your web server and of your wiki instance. Look at the appropriate help page for your web server, then come back here to tune the settings of your wiki instance.

Edit wikiconfig.py. The default settings should work fine in most cases, but there are some things that you will probably want to change, like the name and logo of your wiki! :) Read the comments inside wikiconfig.py, they will guide you through this process. (Start with "Wiki identity", around line 25.)

HelpOnConfiguration contains all the details about all the options, in case the comments in wikiconfig.py are not enough.


--> -->

TypeError

heading() takes exactly 3 arguments (4 given)

If you want to report a bug, please save this page and attach it to your bug report.

Traceback

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

  1. /usr/lib/python2.3/site-packages/MoinMoin/request.py in run (self=<MoinMoin.request.RequestCGI object>)

    1. 1127 pass
    2. 1128 except Exception, err:
    3. 1129 self.fail(err)
    4. 1130
    5. 1131 return self.finish()
    • self = <MoinMoin.request.RequestCGI object>
    • self.fail = <bound method RequestCGI.fail of <MoinMoin.request.RequestCGI object>>
    • err = <exceptions.TypeError instance>
  2. /usr/lib/python2.3/site-packages/MoinMoin/Page.py in send_page (self=<MoinMoin.Page.Page instance>, request=<MoinMoin.request.RequestCGI object>, msg='', **keywords={'count_hit': 1})

    1. 1225 format_args=pi_formatargs,
    2. 1226 do_cache=do_cache,
    3. 1227 start_line=pi_lines)
    4. 1228
    5. 1229 # check for pending footnotes
    • start_line undefined
    • pi_lines = 8
  3. /usr/lib/python2.3/site-packages/MoinMoin/Page.py in send_page_content (self=<MoinMoin.Page.Page instance>, request=<MoinMoin.request.RequestCGI object>, Parser=<class MoinMoin.parser.wiki.Parser>, body=u'\nThis HTML page contains the basic install docs ...alling/TroubleShooting, "Trouble-shooting", 1)]]\n', format_args=u'', do_cache=1, **kw={'start_line': 8})

    1. 1315 except 'CacheNeedsUpdate':
    2. 1316 request.log('page cache failed after creation')
    3. 1317 self.format(parser)
    4. 1318
    5. 1319 request.clock.stop('send_page_content')
    • self = <MoinMoin.Page.Page instance>
    • self.format = <bound method Page.format of <MoinMoin.Page.Page instance>>
    • parser = <MoinMoin.parser.wiki.Parser instance>
  4. /usr/lib/python2.3/site-packages/MoinMoin/Page.py in execute (self=<MoinMoin.Page.Page instance>, request=<MoinMoin.request.RequestCGI object>, parser=<MoinMoin.parser.wiki.Parser instance>, code=<code object ? at 0xb7d0a9a0, file "MoinMoin/InstallDocs", line 2>)

    1. 1332 if hasattr(MoinMoin, '__loader__'):
    2. 1333 __file__ = os.path.join(MoinMoin.__loader__.archive, 'dummy')
    3. 1334 exec code
    4. 1335
    5. 1336 def loadCache(self, request):
    • code = <code object ? at 0xb7d0a9a0, file "MoinMoin/InstallDocs", line 2>
  5. /usr/share/moin/kthlan/cgi-bin/MoinMoin/InstallDocs in ?

  6. /usr/lib/python2.3/site-packages/MoinMoin/formatter/base.py in macro (self=<MoinMoin.formatter.text_html.Formatter instance>, macro_obj=<MoinMoin.wikimacro.Macro instance>, name=u'Include', args=u'HelpOnInstalling/ApacheOnLinux, "Linux Installation using Apache", 1')

    1. 285 def macro(self, macro_obj, name, args):
    2. 286 # call the macro
    3. 287 return macro_obj.execute(name, args)
    4. 288
    5. 289 def _get_bang_args(self, line):
    • macro_obj = <MoinMoin.wikimacro.Macro instance>
    • macro_obj.execute = <bound method Macro.execute of <MoinMoin.wikimacro.Macro instance>>
    • name = u'Include'
    • args = u'HelpOnInstalling/ApacheOnLinux, "Linux Installation using Apache", 1'
  7. /usr/lib/python2.3/site-packages/MoinMoin/wikimacro.py in execute (self=<MoinMoin.wikimacro.Macro instance>, macro_name=u'Include', args=u'HelpOnInstalling/ApacheOnLinux, "Linux Installation using Apache", 1')

    1. 118 else:
    2. 119 raise ImportError("Cannot load macro %s" % macro_name)
    3. 120 return execute(self, args)
    4. 121
    5. 122 def _m_lang(self, text):
    • execute = <function execute>
    • self = <MoinMoin.wikimacro.Macro instance>
    • args = u'HelpOnInstalling/ApacheOnLinux, "Linux Installation using Apache", 1'
  8. /usr/lib/python2.3/site-packages/MoinMoin/macro/Include.py in execute (macro=<MoinMoin.wikimacro.Macro instance>, text=u'HelpOnInstalling/ApacheOnLinux, "Linux Installation using Apache", 1', args_re=<_sre.SRE_Pattern object>, title_re=<_sre.SRE_Pattern object>, called_by_toc=0)

    1. 202 if request._page_headings[pntt] > 1:
    2. 203 hid += '-%d'%(request._page_headings[pntt],)
    3. 204 result.append(
    4. 205 #macro.formatter.heading(1, level, hid,
    5. 206 # icons=edit_icon.replace('<img ', '<img align="right" ')) +
    • result = []
    • result.append = <built-in method append of list object>
    • macro = <MoinMoin.wikimacro.Macro instance>
    • macro.formatter = <MoinMoin.formatter.text_html.Formatter instance>
    • macro.formatter.heading = <bound method Formatter.heading of <MoinMoin.formatter.text_html.Formatter instance>>
    • level = 1
    • hid = 'head-b6f8165502ec5c324085175ef1a3459d596ccefa'
    • inc_page = <MoinMoin.Page.Page instance>
    • inc_page.link_to = <bound method Page.link_to of <MoinMoin.Page.Page instance>>
    • request = <MoinMoin.request.RequestCGI object>
    • heading = u'Linux Installation using Apache'
    • css_class undefined

TypeError

heading() takes exactly 3 arguments (4 given)

  • args = ('heading() takes exactly 3 arguments (4 given)',)

System Details

  • Date: Fri, 01 Nov 2024 01:06:44 +0000
  • Platform: Linux s23.lan.kth.se 2.6.9-55.EL #1 Fri Apr 20 16:35:59 EDT 2007 i686
  • Python: Python 2.3.4 (/usr/bin/python)
  • MoinMoin: Release 1.5.2 (release)