This HTML page contains the basic install docs that can be found on [WWW] 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 [MoinMaster]HelpOnUpdating.

A MoinMoin installation is done by some elementary steps:

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:

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 [WWW] 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 [WWW] 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.


How to create a wiki instance

Security warning

Make sure that your data/ directory is not accessible through your web server, or at least forbid the web server to serve anything below the data/ directory. The web server need to serve moin.cgi and the stuff below htdocs only!

Also make sure that the data/ directory and its subdirectories are not readable or writeable by other users than the web server user and root. If you need to give world rw permissions to get it working, be aware that you are doing an very unsecure setup, that can be compromised by other users of that system.

Creating a wiki instance

Now choose a name for the new wiki instance you want to create (maybe reflecting its use). We use an instance named "mywiki" in this example.

<!> Do not use the name 'wiki', it is reserved for internal use.

Follow the sections below matching your type of installation, either:

  • install to "Arbitrary location" (you need to be root for that), or

  • install to "Home directory" (possible as a normal user, if allowed).

Only Arbitrary location

Now choose a directory (called WIKILOCATION) where your wiki should reside. This could be PREFIX/share/moin (PREFIX see ../BasicInstallation) or any other directory.

You also need to know which USER and GROUP moin will be run as (usually the same as your web server uses).

> export SHARE=/usr/share/moin      # general: PREFIX/share/moin
> export WIKILOCATION=$SHARE        # or any other directory
> export USER=www-data              # the user moin will run as
> export GROUP= www-data            # the group moin will run as

Only Home directory

> export SHARE=~/share/moin         # general: PREFIX/share/moin
> export WIKILOCATION=~             # use home directory

Both

> export INSTANCE=mywiki            # choose a nice name. do NOT use "wiki"!
> 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

Only Arbitrary location

> chown -R $USER.$GROUP $INSTANCE   # USER.GROUP has to match your web server setup
> chmod -R ug+rwX $INSTANCE         # USER.GROUP may read and write
> chmod -R o-rwx $INSTANCE          # no world access - use this for better security

Only Home directory

> chmod -R a+rwX $INSTANCE/data     # moin running under web server uid/gid needs to r/w this
> chmod -R a+rwX $INSTANCE/underlay # and this directory

/!\ Be aware that this setup is UNSECURE and can be compromised by other system users. Better check if it can be done with more restrictive access mode. Ask your web server administrator for details.

Both

Now edit wikiconfig.py. The default settings should work fine in most cases. You will have to change some setting.

sitename = 'My Wiki'
...

[Add more important setup options. This duplicates parts in HelpOnConfiguration, but much better for the user.]

See more options on page HelpOnConfiguration.


Linux Installation using Apache

Index

  1. Installation too an arbitrary location (when you are root or the webmaster)
    1. Creating a wiki instance
  • How to create a wiki instance
    1. Security warning
    2. Creating a wiki instance
      1. Only Arbitrary location
      2. Only Home directory
      3. Both
      4. Only Arbitrary location
      5. Only Home directory
      6. Both
      7. Installing moin.cgi
      8. Apache configuration
    3. Home directory installation (normal user)
      1. Making sure /~username URLs work
      2. Setting up a wiki instance
  • How to create a wiki instance
    1. Security warning
    2. Creating a wiki instance
      1. Only Arbitrary location
      2. Only Home directory
      3. Both
      4. Only Arbitrary location
      5. Only Home directory
      6. Both
      7. Setting up public_html and testing the installation
      8. Troubleshooting
        1. Missing permission to serve the `mywiki` directory

    Installation too an arbitrary location (when you are root or the webmaster)

    Most GNU/Linux distributions come with Apache pre-installed. In the following description, we assume a file system layout with:

    • /etc/httpd/httpd.conf - the main httpd configuration file

    • /var/log/httpd/error_log - log containing error messages

    Creating a wiki instance

    We need to know what USER and GROUP your Apache server runs on, so issue this command:

    > egrep "^User|^Group" /etc/httpd/httpd.conf
    User wwwrun
    Group nogroup
    

    This shows a typical result "wwwrun.nogroup", which we will use now:

    How to create a wiki instance

    Security warning

    Make sure that your data/ directory is not accessible through your web server, or at least forbid the web server to serve anything below the data/ directory. The web server need to serve moin.cgi and the stuff below htdocs only!

    Also make sure that the data/ directory and its subdirectories are not readable or writeable by other users than the web server user and root. If you need to give world rw permissions to get it working, be aware that you are doing an very unsecure setup, that can be compromised by other users of that system.

    Creating a wiki instance

    Now choose a name for the new wiki instance you want to create (maybe reflecting its use). We use an instance named "mywiki" in this example.

    <!> Do not use the name 'wiki', it is reserved for internal use.

    Follow the sections below matching your type of installation, either:

    • install to "Arbitrary location" (you need to be root for that), or

    • install to "Home directory" (possible as a normal user, if allowed).

    Only Arbitrary location

    Now choose a directory (called WIKILOCATION) where your wiki should reside. This could be PREFIX/share/moin (PREFIX see ../BasicInstallation) or any other directory.

    You also need to know which USER and GROUP moin will be run as (usually the same as your web server uses).

    > export SHARE=/usr/share/moin      # general: PREFIX/share/moin
    > export WIKILOCATION=$SHARE        # or any other directory
    > export USER=www-data              # the user moin will run as
    > export GROUP= www-data            # the group moin will run as
    

    Only Home directory

    > export SHARE=~/share/moin         # general: PREFIX/share/moin
    > export WIKILOCATION=~             # use home directory
    

    Both

    > export INSTANCE=mywiki            # choose a nice name. do NOT use "wiki"!
    > 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
    

    Only Arbitrary location

    > chown -R $USER.$GROUP $INSTANCE   # USER.GROUP has to match your web server setup
    > chmod -R ug+rwX $INSTANCE         # USER.GROUP may read and write
    > chmod -R o-rwx $INSTANCE          # no world access - use this for better security
    

    Only Home directory

    > chmod -R a+rwX $INSTANCE/data     # moin running under web server uid/gid needs to r/w this
    > chmod -R a+rwX $INSTANCE/underlay # and this directory
    

    /!\ Be aware that this setup is UNSECURE and can be compromised by other system users. Better check if it can be done with more restrictive access mode. Ask your web server administrator for details.

    Both

    Now edit wikiconfig.py. The default settings should work fine in most cases. You will have to change some setting.

    sitename = 'My Wiki'
    ...
    

    [Add more important setup options. This duplicates parts in HelpOnConfiguration, but much better for the user.]

    See more options on page HelpOnConfiguration.

    .

    Installing moin.cgi

    cd $WIKILOCATION/$INSTANCE
    mkdir cgi-bin
    cp $SHARE/moin/server/moin.cgi cgi-bin
    chown -R $USER.$GROUP cgi-bin
    chmod -R ug+rx cgi-bin
    

    Apache configuration

    These commands add some lines at bottom of "/etc/httpd/httpd.conf" (you maybe have to move them to the right place):

    # again: DO NOT use /wiki for both! That doesn't work.
    > echo "" >>/etc/httpd/httpd.conf
    > echo "Alias /wiki/ \"$SHARE/htdocs/\"" >>/etc/httpd/httpd.conf
    > echo "ScriptAlias /mywiki \"$WIKILOCATION/$INSTANCE/cgi-bin/moin.cgi\"" >>/etc/httpd/httpd.conf
    

    The Alias line you only need once; the ScriptAlias line is needed once for each wiki instance (of course, each one with another wiki name and path).

    Edit wikiconfig.py again so moin knows under which URL it will find the htdocs stuff:

    url_prefix = '/wiki'
    

    That is all, restart your Apache server (usually "/etc/init.d/apache restart") and try to access your new-born wiki with the URL "http://127.0.0.1/mywiki/". You should see the FrontPage, try to edit and save it, and if that works, see if your edit is reflected on the RecentChanges page.

    Home directory installation (normal user)

    Installation into your shell account's home directory is typically used on a host shared by many users and where you are not the root user. This usually implies that you cannot change the httpd.conf file, and also you cannot copy files into the machine's cgi-bin and htdocs directories. For this situation, Apache includes the UserDir directive, which maps all URLs that start with "/~username" to a directory in your home directory, where you have write permissions and thus can install MoinMoin.

    The examples use "jh" (Juergen Hermann) as the user's name, which means you have to replace your own one whereever "jh" appears.

    Making sure /~username URLs work

    This kind of setup can only work if your webmaster has configured the host's Apache server so that the UserDir mechanism works. Here's how to check for this:

    > ls -ld ~/public_html
    drwxr-xr-x   2 jh       users          35 Jan 31 00:29 public_html
    

    If this does not show a listing like above, then you might need to create the public_htmldirectory. Note that this directory must be readable (r-x) by the web server.

    > lynx -error_file=/dev/stderr -dump http://localhost/~jh/ >/dev/null
    URL=http://localhost/~jh/ (GET)
    STATUS=HTTP/1.1 200 OK
    

    You see here that we get a "200 OK" status response, which means that you can access your public_html area. If it does not work, you will probably get a "403 Forbidden" or a "404 Not Found" response. The first one normally indicates that you need to fix the permissions of your home directory (~) or your ~/public_html. But we also need to be able to execute CGI scripts, so we test that, too.

    > mkdir -p ~/public_html/cgi-bin
    > cat > ~/public_html/cgi-bin/test.cgi
    #!/bin/sh
    echo Content-Type: text/plain
    echo
    echo IT WORKS
    <CTRL-D>
    > chmod a+rx ~/public_html/cgi-bin/test.cgi
    > lynx -dump http://localhost/~jh/cgi-bin/test.cgi
    IT WORKS
    

    If you see anything else than "IT WORKS", then you are not allowed to execute CGI scripts. How you get that to work is not in the scope of this description, ask your webmaster!

    Setting up a wiki instance

    How to create a wiki instance

    Security warning

    Make sure that your data/ directory is not accessible through your web server, or at least forbid the web server to serve anything below the data/ directory. The web server need to serve moin.cgi and the stuff below htdocs only!

    Also make sure that the data/ directory and its subdirectories are not readable or writeable by other users than the web server user and root. If you need to give world rw permissions to get it working, be aware that you are doing an very unsecure setup, that can be compromised by other users of that system.

    Creating a wiki instance

    Now choose a name for the new wiki instance you want to create (maybe reflecting its use). We use an instance named "mywiki" in this example.

    <!> Do not use the name 'wiki', it is reserved for internal use.

    Follow the sections below matching your type of installation, either:

    • install to "Arbitrary location" (you need to be root for that), or

    • install to "Home directory" (possible as a normal user, if allowed).

    Only Arbitrary location

    Now choose a directory (called WIKILOCATION) where your wiki should reside. This could be PREFIX/share/moin (PREFIX see ../BasicInstallation) or any other directory.

    You also need to know which USER and GROUP moin will be run as (usually the same as your web server uses).

    > export SHARE=/usr/share/moin      # general: PREFIX/share/moin
    > export WIKILOCATION=$SHARE        # or any other directory
    > export USER=www-data              # the user moin will run as
    > export GROUP= www-data            # the group moin will run as
    

    Only Home directory

    > export SHARE=~/share/moin         # general: PREFIX/share/moin
    > export WIKILOCATION=~             # use home directory
    

    Both

    > export INSTANCE=mywiki            # choose a nice name. do NOT use "wiki"!
    > 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
    

    Only Arbitrary location

    > chown -R $USER.$GROUP $INSTANCE   # USER.GROUP has to match your web server setup
    > chmod -R ug+rwX $INSTANCE         # USER.GROUP may read and write
    > chmod -R o-rwx $INSTANCE          # no world access - use this for better security
    

    Only Home directory

    > chmod -R a+rwX $INSTANCE/data     # moin running under web server uid/gid needs to r/w this
    > chmod -R a+rwX $INSTANCE/underlay # and this directory
    

    /!\ Be aware that this setup is UNSECURE and can be compromised by other system users. Better check if it can be done with more restrictive access mode. Ask your web server administrator for details.

    Both

    Now edit wikiconfig.py. The default settings should work fine in most cases. You will have to change some setting.

    sitename = 'My Wiki'
    ...
    

    [Add more important setup options. This duplicates parts in HelpOnConfiguration, but much better for the user.]

    See more options on page HelpOnConfiguration.

    Setting up public_html and testing the installation

    Now we create the public part of the wiki, which is directly accessible by the web browser.

    > cd ~/public_html
    > cp -r ~/share/moin/htdocs wiki
    

    Edit $WIKILOCATION/$INSTANCE/wikiconfig.py again so moin knows under which URL it will find the htdocs stuff, the data, and the underlay:

    ...
    data_dir = '/home/jh/mywiki/data/'
    data_underlay_dir = '/home/jh/mywiki/underlay/'
    url_prefix = '/~jh/wiki'
    ...
    
    > cd ~/public_html
    > mkdir -p cgi-bin
    > cp $SHARE/server/moin.cgi cgi-bin
    > chmod -R a+rx cgi-bin
    

    To be able to execute the CGI script in your home directory, you need to extend Python's path within that script, and possibly adapt the bang path (that is the first line of the script). So, change "moin.cgi":

    #! /usr/bin/python2.3
    ...
    import sys
    sys.path.extend(['/home/jh/mywiki', '/home/jh/lib/python2.3'])
    ...
    

    Finally, you can test your wiki installation by running the MoinMoin CGI Diagnosis:

    > lynx -dump http://localhost/~jh/cgi-bin/moin.cgi?action=test
    

    And now, your wiki should work and is available at the URL "http://localhost/~jh/cgi-bin/moin.cgi". Conclude your tests by editing and saving the FrontPage and checking out RecentChanges, which should reflect that edit.

    Troubleshooting

    See also ../TroubleShooting for generic stuff.

    The first thing to do when your wiki does not work as expected is to issue the command "tail /var/log/httpd/error_log" to display the most recent errors. Usually, you will get a hint on what went wrong, like missing file system permissions.

    Missing permission to serve the `mywiki` directory

    In some linux distributions (like SuSE 9.0) serving of directories other than the document-root "/srv/www/htdocs" with Apache is switched off by default for security reasons in "/etc/httpd/httpd.conf" (or for Apache2 "/etc/apach2/httpd.conf"):

    * forbid access to the entire filesystem by default
    <Directory />
      Options None
      AllowOverride None
      Order deny, allow
      Deny from all
    </Directory>
    

    To allow apache serving directories outside of the document root you have to add these lines to "/etc/httpd/httpd.conf" (in SuSE it is recommended to create a new "http.conf.local" and include this file in "/etc/sysconfig/apache2"):

    Alias /wiki/ "/usr/share/moin/htdocs/"
    <Directory "/usr/share/moin/htdocs/>
       Order deny,allow
       Allow from all
    </Directory>
    
    ScriptAlias /mywiki "/usr/share/moin/mywiki/cgi-bin/moin.cgi"
    <Directory "/usr/local/moin/mywiki/cgi-bin/moin.cgi">
       Order deny,allow
       Allow from all
    </Directory>
    

  • FastCGI Setup using Apache

    Using MoinMoin with apache + mod_fastcgi

    [WWW] FastCGI is a method which enables apache to communicate with long-running scripts. This has the advantage that the script is only started and initialized one time, and that data could be cached in memory from request to request, enhancing the performance of the CGI application.

    Deploying MoinMoin with apache + mod_fastcgi

    To deploy MoinMoin using FastCGI you need an apache with mod_fastcgi. Please refer to the documentation of mod_fastcgi how to build it.

    Follow the basic apache installation for your operating system as described in other parts of the MoinMoin installation documentation. In places where the documentation refers to moin.cgi you use moin.fcg instead. Be sure that .fcg is handled by the FastCGI module (AddHandler fastcgi-script .fcg in your apache config).

    Normally apache will start CGI scripts with its own user and group, or with the user and group of the !VirtualHost if you are using the suexec wrapper. To enable this with FastCGI you need to use FastCgiWrapper On in your apache config (see FastCGI Documentation).

    Be sure to restart your apache, after you changed py files (i.e. the config) for a running FastCGI server, or you won't see any changes!


    mod_python Setup using Apache

    Using MoinMoin with apache + mod_python

    [WWW] mod_python embeds the python interpreter into the apache server. This saves initialization time and the need of forking cgi scripts. It doesn't have the ability to run as different users. It will always run as the main apache user and group. Be sure that your wiki data files are accessible by your apache server!

    /!\ mod_python versions before 3.1.3 have a bug in apache.resolve_object This bug is fixed in version 3.1.3 an will perhaps fixed in later 2.X releases for apache 1.3.

    Deploying MoinMoin with mod_python

    Follow the basic apache installation for your operating system as described in other parts of the MoinMoin installation documentation. Don't copy moin.cgi, cause you won't need it. Be sure that the apache process can access the wiki data files (check User and Group in your apache.conf).

    Copy the sample moin_modpy.htaccess as .htaccess to the path below which your wiki instance should be found:

    cd /usr/local/share/moin
    cp wiki/cgi-bin/moin_modpy.htaccess /path/to/your/docroot/.htaccess
    

    Check the .htaccess that the PythonPath matches your installation. It should contain the path where the moin_modpy.py wrapper is installed (Note: the wrapper does not have to be within your DOCROOT). You can also change the name of your instance (<Files wikiname>).

    Check sys.path of moin_modpy.py. It needs to find the MoinMoin package (not needed if MoinMoin is installed system wide) and your wikiconfig.py.

    In some cases you need to restart apache after changes to py files used by mod_python. Please refer to the mod_python documentation.

    reading of .htaccess

    In SuSE Linux 9.0 reading of .htaccess is switched off by default in "/etc/apache2/http.conf" with

    * forbid access to the entire filesystem by default
    <Directory />
      Options None
      AllowOverride None
      Qrder deny, allow
      Deny from all
    </Directory>
    

    To allow Apache processing your .htaccess file (in your document root) you have to modify "/etc/apache2/http.conf" (for SuSE it is actually recommended to create a new "http.conf.local" and include it in "/etc/sysconfig/apache2").

    <Directory "/src/www/htdocs"
       # this is the document root in Suse
       AllowOverride All 
    </Directory>
    

    Fixing the mod_python bug

    /!\ If you did use the wrapper setup from the previous section, you don't need to do this.

    mod_python has a small resolver bug in versions before 3.1.3. The method resolve_object in mod_python/apache.py checks the wrong object, and so the lookup for RequestModPy.run fails. You have two possibilities to live with it: either use the wrapper script moin_modpy.py or fix the bug.

    To fix it you need to change the method resolve_object (around line 551 for mod_python 3.1.2b) from

            if silent and not hasattr(module, obj_str):
                return None
    

    to

            if silent and not hasattr(obj, obj_str):
                return None
    

    This bug is currently in all versions of mod_python before 3.1.3. It might be fixed in a next 2.X release for apache 1.3, too.

    Deploying with a fixed mod_python

    /!\ This section only works with a fixed mod_python (see previous section)!

    Follow the deployment documentation above. Use the special commented out section of moin_modpy.htaccess instead of the default wrapper using part.

    Check the PythonPath in the .htaccess that it matches your installation. It should contain the python lib path where the MoinMoin package is stored (not needed if MoinMoin is installed system wide) and the path to your wikiconfig.py.

    The wrapper script moin_modpy.py is not needed, cause the !RequestModPy class is used directly by mod_python.

    Installing to base root with ModPython

    None of the above instructions work if you want to make MoinMoin work at the base url and use ModPython (i.e. [WWW] http://www.myserver.com/ and not [WWW] http://www.myserver.com/wiki ). Here is what worked for me for setting up MoinMoin for use with multiple virtual servers (these are instructions for modpython 3.1.3 or later):

    Remember to replace "mywiki" in all these instructions with whatever name you chose.

    I keep the folders for the various wikis as subdirectories of /usr/share/moin. Similar to the regular install instructions, do this after running python setup.py install for moinmoin:

    cd /usr/share/moin
    mkdir mywiki
    cp -r data mywiki
    cp config/wikiconfig.py mywiki  (this is the only file you need)
    chown -R www-data:www-data mywiki (use the user and group of apache)
    

    Edit your apache configuration file to allow the moin parent folder to override !FileInfo at least:

    <Directory "/usr/share/moin">
     Options Indexes Includes FollowSymLinks MultiViews
     AllowOverride All  #you need to allow FileInfo at least
     Order allow,deny
     Allow from all
    </Directory>
    

    For your server or virtual host, you need to set at least the two Aliases:

    <VirtualHost your.ip.address>
        ServerName your.server.name
        DocumentRoot /usr/share/moin/mywiki  #not really necessary
        ServerAdmin webmaster@your.server.name
    
        #This next line allows shared moinmoin images to load
        Alias /wiki/ "/usr/share/moin/htdocs/"
    
        #This is the line that passes a name to your python handler,
        #  the trailing slash is necessary
        Alias / "/usr/share/moin/mywiki/"
    </VirtualHost>
    

    Edit /usr/share/moin/mywiki/wikiconfig.py:

    sitename = 'My Wiki'
    interwikiname = 'MyWiki'
    data_dir = '/usr/share/moin/mywiki/data/'  #this needs to be a FULL path
    

    And most importantly, you need to add an .htaccess file under /usr/share/moin/wiki1/ (or else add these lines to your main httpd.conf file:

    # PythonDebug On
    <Files mywiki>
      SetHandler python-program
      PythonPath "['/usr/share/moin/mywiki/']+sys.path"
      PythonHandler MoinMoin.request::RequestModPy.run
    </Files>
    


    Setup using Twisted

    Using MoinMoin with Twisted

    [WWW] Twisted is a standalone python framework for many kinds of applications. For MoinMoin, we use twisted as a python web server that just imports MoinMoin persistently.

    This has the advantage that the Python interpreter and all Python scripts (including twisted itself and also MoinMoin) is only loaded and initialized one time, and that data can be cached in memory from request to request, enhancing the performance of MoinMoin.

    Another advantage is that this is all based on Python. ;)

    First do ../BasicInstallation and ../WikiInstanceCreation.

    Install Twisted

    First install twisted (see URL above). Many Linux distributions have twisted packages. Please refer to the documentation of twisted how to install it.

    Configuring the twisted server

    Copy the file wiki/server/mointwisted.py to your wiki directory. Edit and adapt the settings to your needs.

    System path configuration

    If you did a standard install, and you are not a developer, you probably want to skip this section. If not, you might want to add the path to moin and config file, like that:

    sys.path.append('/path/to/moin')
    sys.path.append('/path/to/wikiconfig')
    

    Config class options

    If you did a standard install, the default options might be just what you need. Check and change what you like:

    Option

    Default

    Comment

    docs

    '/usr/share/moin/wiki/htdocs'

    Path to moin shared files

    user

    'www-data'

    If you run as root, the server will run with as this user

    group

    'www-data'

    If you run as root, the server will run with as this group

    port

    8080

    Port to serve. To serve privileged port under 1024 you will have to run as root

    interfaces

    ['']

    The interfaces the server will listen to. The default will listen to all. You can set to a list of interfaces you like to listen. If '' is in the list, all other ignored.

    logPath

    'mointwisted.log'

    Log file. Default is commented.

    profiler

    commented python code

    Useful only if you are a moin developer.

    Configuring wikiconfig.py

    The sample config file should be just fine.

    Option

    Default

    Comment

    url_prefix

    '/wiki'

    You should not change this, or images and css file will not be available to the wiki!

    Starting the server on Unix

    On GNU/Linux, Mac OS X or other posix like OS, copy wiki/server/mointwisted to your wiki directory. You might want to adapt the python path and the path to twistd.

    Start the server with ./mointwisted start and test your wiki at [WWW] http://localhost:8080/. Stop the server with ./mointwisted stop.

    Starting the server on Win32

    Copy wiki/server/mointwisted.cmd to your wiki directory. You might have to change the path pointing to the python-scripts directory.

    Double click mointwisted.cmd to start the server. It will create a new terminal window. To stop the server, close the terminal window.


    Linux Installation using standalone server


    Mac OS X Installation using Apache

    /!\ This is pre-1.3 stuff that still has to be adapted to 1.3.

    Installing MoinMoin on OS X

    You must not be afraid to use the terminal. It is possible but much harder to install without the using the terminal.

    There are 2 step in the installation:

    1. Install the MoinMoin engine - once

    2. Create wiki instance. You can create and serve as many wikis as you like.

    Download

    Download the source on the Desktop. You should see a moin-x.x.tar.gz file. Extract this file on the desktop with Stuffit Expander, or from the terminal (faster and safer):

    cd ~/Desktop
    tar -xzf moin-1.3.tar.gz
    

    Install

    Use these commands in the terminal to install the !MoinMoin wiki engine into the system.

    First, open a shell as root. You will need this to install MoinMoin and configure the wiki. When asked, enter your password.

    sudo -s
    ... password:
    

    Now you have root privileges in this shell.

    Install:

    cd moin-1.3
    python setup.py install --install-data='/usr'  --record=install.log 
    
    • (!) The --install-data='/usr' will put the shared data in the convinient '/usr/share/moin' directory. If you don't use it, your shared data will be at '/System/Library/Frameworks/Python.framework/Versions/2.3/share/moin'.

    Now installation is finished. You will find a file install.log on the Desktop in the folder moin-1.3.

    Creating a wiki

    After you installed the software, you create a wiki. You may create several wikis if you need.

    First check what is the user and group name of the web server. The wiki files will belong to the web server (not to you):

    egrep "^User|^Group" /etc/httpd/httpd.conf
    User www
    Group www
    

    You wil use these name soon...

    Now create a copy of the default wiki:

    cd /usr/share/moin
    mkdir mywiki
    cp -r data mywiki
    cp cgi-bin/* mywiki
    chown -R www:www mywiki
    chmod a+rx mywiki/*.cgi
    

    Configure Apache. We'll use the pico editor:

    pico /etc/httpd/httpd.conf
    

    Go the end of the Aliasess section and edit like the example below:

        Alias /wiki/ "/usr/share/moin/htdocs/"      
        ScriptAlias /mywiki "/usr/share/moin/mywiki/moin.cgi"       
    

    Use Control+O to save the file and Control+X to exit pico.

    Restart Apache - open System Preferences, go to the Sharing page, select "Personal Web Sharing" and click "Stop" then "Start". Or just type this instead:

    apachectl graceful
    ... /usr/sbin/apachectl graceful: httpd gracefully restarted
    

    Installation finished - exit from the shell with the root privileges - working as root is dangerous.

    exit
    

    Now you are running again safely.

    Testing

    In a web-browser surf to the site: [WWW] http://localhost/mywiki

    You should see the !FrontPage of your new wiki.

    Now run the unit tests, to make sure everything is fine. Go to this address: [WWW] http://localhost/mywiki?action=test

    You should see a report on the wiki and tests results for the MoinMoin engine. If some of the tests fail, please report the problem on [WWW] MoinMoinBugs.

    Comments

    Here are a couple of issues with my Mac OS X install I needed to fix:

    1. The RSS feed for your RecentChanges page may be broken. You need to install the most recent version of [WWW] PyXML. Here's how I did so and the RSS feed was fixed.
      curl -O http://aleron.dl.sourceforge.net/sourceforge/pyxml/PyXML-0.8.3.tar.gz
      tar xzvf PyXML-0.8.3.tar.gz
      cd PyXML-0.8.3
      sudo python setup.py --without-xpath build
      sudo python setup.py install


    Windows Installation using Apache

    /!\ This is pre-1.3 stuff that still has to be adapted to 1.3.

    Index

    1. Requirements
    2. Preparation
      1. MSI Installer
      2. Installing Apache
      3. Installing Python
    3. Installing MoinMoin
    4. Creating a Wiki Instance
    5. Troubleshooting
      1. Internal Server Error
      2. Not Found
      3. The Page Cannot be found
      4. FrontPage Loads Without Icons

    Requirements

    Before you install MoinMoin, you must have the necessary infrastructure in place. This procedure explains the steps necessary to install the infrastructure and provides detailed instructions for the installation of MoinMoin.

    Downloading and installing all of the required components will require almost 100 MB of disk space - shouldn't be a problem nowadays, right?

    Many users prefer to install software products in a folder other than the installation default. Python typically changes the default installation folder name with each point release, and Apache has changed the default installation folder name with the release of version 2. Instead of enumerating all the possibilities at each step, this procedure will use the Reference name in the table below as the installed location for each product. Substitute your real installation location when editing configuration files and entering commands.

    Reference

    Product

    Installation Default or Typical Name

    C:\Apache

    Apache

    C:\Program Files\Apache Group\Apache2

    C:\Python

    Python

    C:\Python22

    C:\Moin

    wiki instances

    C:\My Documents\Moin

    This installation procedure was tested with Apache 1.3.26 and Apache 2.0.44 for Windows running on Windows/ME, and using Python 2.2.2 and 2.3.

    Preparation

    MSI Installer

    Installation of Apache and one alternative distribution of Python require the Microsoft MSI Installer. The latest version, 2.0, was released in September of 2001. You will know you don't have the correct version if you receive errors after double-clicking on a file name ending in .msi. To get the latest version, go to [WWW] http://www.microsoft.com/, search for msi installer, and follow the instructions. There are two versions, one for Windows/ME, 98, and 95; and another for Windows 2000 and NT. Windows/XP has the 2.0 version and requires no update.

    Installing Apache

    To obtain the latest version of Apache, go to [WWW] http://www.apache.org/, and click on the link to HTTP Server. Find the link to download the Win32 Binary (MSI Installer) version. Read the Apache documentation to determine the correct installation procedure for your situation. Questions and problems with the Apache installation process should be resolved through use of the resources provided by the Apache organization. Be sure your webserver runs correctly before proceeding.

    Warning: the procedure described above tends to trivialize the installation of the Apache web server. Apache can be installed and running on your PC in a very few minutes with only a cursory examination of the Apache documentation. Before you undertake the installation of any web server that can be accessed through the internet, you should exercise a controlled level of paranoia and assess the potential damage that may be caused by hackers accessing or destroying sensitive data. This should include not only the all data which resides on the PC which will host the Apache web server, but all other PCs on the local LAN which participate in any form of file sharing.

    Windows/ME, 98SE, 98, 95, and probably NT should be considered inappropriate hosts for any Apache web server that can be accessed via the internet. Use either Windows/2000 or XP and install all security patches available for your operating system.

    Do not let the above discourage you from installing MoinMoin. Most of the internet activity probing your system for weaknesses will be from virus infected Windows/NT systems running IIS whose owners have neglected to apply available security patches. The starting Apache configuration is secure and you will not have a problem provided you:

    • Regularly review and apply security patches for your installed software.

    • Understand the ramifications of any changes you make to the Apache config files.

    • Regularly review the Apache logs for suspicious activity.

    • Regularly take backups of your data.

    Installing Python

    There are currently two different distributions of Python available for Windows. The normal Python distribution is available from [WWW] http://www.python.org. This is distributed as a windows executable (.exe) file.

    An alternative distribution called ActivePython is available from [WWW] http://www.activestate.com/. This distribution uses the MSI Installer and contains some tools specific to the Windows operating system and a popular Windows IDE called Pythonwin. ActivePython is available for free; an email address is requested (but not required) before downloading.

    MoinMoin will work with either distribution, but requires Python release 2.2.2 or later. Download and install the distribution of your choice. Questions and problems dealing with the Python installation process should be resolved through the use of resources provided by Python.org or ActiveState. Be sure your Python installation is correct before proceeding.

    For file locking, you will also need to download and install the [WWW] Win32 extensions for Python (aka win32all). Choose the version matching the Python version you are using. The alternative ActivePython distribution discussed above include these extensions.

    Installing MoinMoin

    Download the current version of MoinMoin from [WWW] http://moinmoin.wikiwikiweb.de/ into C:\TEMP or an alternative location. For the .tar.gz format try WinZip.

    You should then have a folder C:\TEMP\moin-x.x where "x.x" is the current release number. This folder will contain a setup.py file in addition to several other files and subfolders.

    Open an MS-DOS or console window and enter the commands:

    C:
    cd \TEMP\moin-x.x
    C:\Python\python setup.py install --record=install.log
    

    The above commands will add MoinMoin to your C:\Python installation and create an install.log file in C:\temp\moin-x.x listing all the copied files. You may use Windows Explorer to examine the newly created folders within C:\Python. You should find a C:\Python\share\moin folder with subfolders cgi-bin, data, and htdocs. With Python 2.2 and later it will be C:\Python\Lib\site-packages\MoinMoin. The MoinMoin folder contains many Python scripts and several subfolders.

    You are now ready to create a wiki instance.

    Creating a Wiki Instance

    It is a good practice to try to keep all of your personal or site specific data under a few root folders. This way you can easily backup your important data on a regular basis without having to waste time either backing up static files or picking out dozens of important folders scattered throughout your folder structure. You should avoid placing your wiki data under the C:\Python folder so that you can later upgrade Python or MoinMoin without accidentally overwriting or deleting your wiki data. For the same reason, you probably don't want to place your wiki data within the C:\Apache folder. The default personal folder under many Windows versions is called C:\My Documents.

    Choose a location appropriate for you; the following instructions assume you will be creating one or more wiki instances in C:\Moin\ and the first wiki instance will be named mywiki.

    You may replace the name mywiki with almost any name you wish, but do not use wiki because that is used by MoinMoin for loading standard images and style sheets. Although this can be changed later, the plan is that the name you choose for mywiki will become part of the url used to access your site, e.g. http://myorganization.org/mywiki/FrontPage.

    Start an MS-DOS or console window and enter the commands below. This will create a clone of the MoinMoin wiki in the mywiki folder. The wikidata folder will be used later for mywiki customization, such as logos and style sheets.

    cd C:\ 
    md Moin
    md Moin\wikidata
    md Moin\mywiki
    md Moin\mywiki\data
    md Moin\mywiki\underlay
    cd \Python\share\moin
    xcopy data        C:\Moin\mywiki\data /E
    xcopy underlay    C:\Moin\mywiki\underlay /E
    copy  cgi-bin\*.* C:\Moin\mywiki\*.*
    

    If your server is going to run multiple wikis, you need to create additional clones. Do the same commands again, but use mywiki2 instead of mywiki.

    Use your editor to edit the file C:\Moin\mywiki\moin.cgi. Change the first line (the shebang statement) to point to your local Python executable program. Note the forward slashes -- Apache uses the Unix convention for folder separators. This tells Apache the moin.cgi file is an executable script that will be interpreted by a program to be loaded from C:/Python/python.

    
    #! C:/Python/python
    

    The next step is to tell Apache that is has more work to do. Use your editor to append the following lines to C:\Apache\conf\httpd.conf. Note the presence and absence of trailing slashes, it is important to enter the lines exactly as shown below.

    Alias       /wiki/     "C:/Python/share/moin/htdocs/"
    Alias       /wikidata/ "C:/Moin/wikidata/"
    ScriptAlias /mywiki    "C:/Moin/mywiki/moin.cgi"
    

    The Alias lines for wiki and wikidata above instructs Apache to serve images, style sheets, etc. from the specified folders and subfolders. The ScriptAlias line is needed once for each wiki instance, so if you have multiple wikis, repeat the statement using mywiki2, mywiki3, etc. The ScriptAlias statement instructs Apache to execute scripts from the specified folder. See the Apache docs for a complete explanation.

    Test your changes by restarting your Apache server and try to access your newborn wiki with the URL http://127.0.0.1/mywiki. You should see the FrontPage, try to edit and save it, and if that works, verify your edit is reflected on the RecentChanges page.

    Finally, edit C:\Moin\mywiki\wikiconfig.py and at least change sitename to the name of your wiki:

    sitename = 'My Wiki'
    

    If you want to replace the MoinMoin logo with one named mywikilogo.gif, copy your logo to C:\Moin\wikidata and change logo_url in wikiconfig.py as follows:

    logo_url = '/wikidata/mywikilogo.gif'
    

    For a personal or intranet installation, you'll normally also add this line to wikiconfig.py:

    allowed_actions = ['DeletePage', 'AttachFile', 'RenamePage', ]
    

    Additional configuration details can be found in HelpOnConfiguration.

    And now, it is up to you and your user community to transform your wiki into an informative and useful tool. You will probably want to retain most of the HelpOn~ pages dealing with editing, delete those pages with irrelevant information (like this page, don't let your users or boss know how easy it was to install MoinMoin ;) ), and rewrite the FrontPage to introduce your wiki topic.

    Troubleshooting

    The first place to look for clues when the unexpected happens is to try changing your url to: http://127.0.0.1/mywiki?action=test. If Apache can find and execute the module C:/Moin/mywiki/moin.cgi, a page of diagnostics titled MoinMoin CGI Diagnosis will be displayed. Check the output for error messages.

    The second place to look for is C:\Apache\logs\error.log. The following are common errors grouped by the message displayed by your browser.

    Internal Server Error

    If the Apache log shows a message "The system cannot find the file specified." then a possibility is the shebang statement in moin.cgi is incorrect.

    If the Apache log shows a different error message, then the MoinMoin Python scripts may be abending. To determine the cause, you could try temporarily renaming moin.cgi to moin.py, loading moin.py with the Python idle IDE and executing it to determine if there are any error messages.

    Not Found

    If the Apache error log shows the message "File does not exist: C:/Apache/htdocs/mywiki", the ScriptAlias statement in httpd.conf may be incorrect.

    The Page Cannot be found

    If the Apache error log shows the message "File does not exist: C:/Apache/htdocs/????", you may have mistyped the url "[WWW] http://127.0.0.1/mywiki" into your browser.

    FrontPage Loads Without Icons

    If the Apache Error log shows many error messages "File does not exist: C:/Apache/htdocs/wiki", then the Alias statement in httpd.conf may be incorrect.


    Windows Installation using IIS

    /!\ This is pre-1.3 stuff that still has to be adapted to 1.3. If nobody feels like having to update it, this instructions will be deleted soon.

    Index

    1. Requirements
    2. Preparation
      1. Installing IIS
      2. Installing Python
      3. Installing MoinMoin
    3. Creating a Wiki Instance
      1. IIS 6.0 (Windows.NET Server 2003)
      2. Troubleshooting

    Requirements

    Before you install [MoinMoin]MoinMoin, make sure you have the necessary infra-structure in place, namely the Internet Information Services webserver (any version should be OK), and a Python installation (version 2.2.2 is required, 2.3 or higher is recommended).

    In the following description, we assume that you have installed or will install things to these locations:

    • IIS to its default location

    • C:\Python - the Python interpreter

    • C:\Moin - MoinMoin itself

    Quite often, you might want to install things elsewhere, which is no problem at all; you just have to adapt any paths that appear in a command or config file to the locations you have chosen.

    This installation procedure was tested with IIS 5 for Windows running on Windows 2000sp2, and using Python 2.2.2.

    Preparation

    Installing IIS

    You currently need an external webserver to run MoinMoin.

    From Microsoft: ([WWW] http://www.microsoft.com/windows2000/en/server/iis/)

    • To install IIS, add components, or remove components:

      Click Start, point to Settings, click Control Panel and start the Add/Remove Programs application. Select Configure Windows, click the Components button, and then follow the on-screen instructions to install, remove, or add components to IIS.

    Make sure that your webserver runs without problems before you start to install MoinMoin; problems with your webserver installation are not in the scope of this document.

    Installing Python

    Download [WWW] Python 2.3.4 and install it. Python installation is done via a standard Windows installer program.

    For file locking, you will also need to download and install the [WWW] Win32 extensions for Python (aka win32all). Choose the version matching the Python version you are using.

    Installing MoinMoin

    Before creating a wiki instance, you have to download and install the basic MoinMoin software. We assume you already have downloaded the distribution archive to the "C:\TEMP" directory.

    Open a console window and enter the following commands:

    C:
    cd \temp
    unzip moin-1.3.zip
    cd moin-1.3
    python setup.py install --prefix=C:\Moin --record=install.log
    

    This will install all necessary files to the "C:\Moin" directory, and create a "install.log" file listing all the files that are created there.

    Creating a Wiki Instance

    Enter these commands in a console window:

    cd \Moin
    md mywiki
    md mywiki\data
    md mywiki\underlay
    xcopy share\moin\data mywiki\data /E
    xcopy share\moin\underlay mywiki\underlay /E
    copy share\moin\server\moin.cgi mywiki\
    copy share\moin\htdocs\index.html mywiki\default.htm
    

    "mywiki" is the name of your wiki instance, you might want to chose a different name best fitting the intended use of this instance; just don't name it simply "wiki", because that would result in confusion and problems later on.

    We have to make sure that moin.cgi can find the MoinMoin directory, so that "import MoinMoin" will work. The easiest way to make sure MoinMoin can be imported is to append to sys.path within moin.cgi.

    You can change the first two lines of code in moin.cgi to something like this:

       1 #!python
       2 import sys
       3 sys.path.append(r'C:\Moin\Lib\site-packages')
    

    Notice that we're pointing to the directory which contains the MoinMoin directory, not the directory itself.

    Next, you'll need to create two virtual directories in IIS. One for the shared data, and one for this specific wiki instance.

    Go to Control Panel => Administrative Tools => Internet Information Service. Open up the tree to Default Web Site.

    Right click on Default Web Site and choose New => Virtual directory. This will bring up a wizard with the manditory useless first screen, hit next. Enter "wiki" for the alias name and hit next. Browse to "C:\Moin\share\moin\htdocs" and hit next. Leave the Access permissions at their defaults and hit next. And now you're done, hit finish!

    Now follow the same steps, but set the alias to "mywiki" and the path to "C:\Moin\mywiki".

    Now you need to setup the 'mywiki' alias so that it will run Python to interpret .cgi files. Right click on your new 'mywiki' alias and choose Properties. On the first tab (Virtual Directory), click the Configuration button. The first tab is the App Mappings tab, which defines which programs to use for each file exetension. Click Add. Browse to your python.exe (probably something like c:\pythonXX\python.exe). Then add -u %s %s after the Python executable path. The Executable line will look something like this: C:\Python22\python.exe -u %s %s. In the Extension box enter .cgi with the begining period. Confirm that the Check that file exists option is not checked (if it is, MoinMoin won't be able to display sub pages). Ok, you're done with the alias configuration, click OK several times to get back out of all the dialog boxes.

    If you add another wiki instance, you'll only need to setup the reference to its folder, they can safely share the "wiki" alias which points to static files only.

    That is all, try to access your new-born wiki with the URL "http://127.0.0.1/mywiki/". You should see the FrontPage, try to edit and save it, and if that works, see if your edit is reflected on the RecentChanges page.

    Finally, edit "wikiconfig.py" and at least change "sitename" and "logo_url" to some personal values:

    sitename = 'My Wiki'
    logo_url = '/images/mywiki-logo.gif'
    

    For a personal or intranet installation, you'll normally also add the line

    allowed_actions = ['DeletePage', 'AttachFile', 'RenamePage', ]
    

    IIS 6.0 (Windows.NET Server 2003)

    The instructions below also apply to IIS 6.0 but the more aggressive security settings in newer version of IIS disallow the usage of unknown CGI extensions. That means you will always get a 404 error unless you do this:

    1. Open "Internet Information Services (IIS)" in the control panel.

    2. Go the the "Web Service Extensions" folder.

    3. There you will see "All Unknown CGI Extensions" is probably set to "Prohibited". Make it "Allowed" and MoinMoin should now work.

    At the time I'm writing this, I'm running Windows.NET Standard Server 2003 _RC1_. It may be different in later version. But if you get a 404 error on moin.cgi after following the regular steps, double-check that setting.

    Enabling "All Unknown CGI Extensions" can be a security hole. To just enable Python CGI scripts, add and enable a new web service extension where the 'required files' exactly match the path plus arguments as described above (e.g. C:\Python23\python.exe -u %s %s). You cannot have any spaces in the path to python.exe. There are also permission issues related to the user executing the moinmoin code (access to cmd.exe) which I have not yet sorted through. -- mb

    Troubleshooting

    If you see an error like "ImportError: No module named MoinMoin", it means that python cannot find MoinMoin. See above for how to add to sys.path.

    If you see an error like Error 13: Permission Denied, it means that your web user permissions for the files do not have write/modify enabled.


    Trouble-shooting

    Built-in test

    There's a built-in diagnostic mode that's useful when doing an install; just append "?action=test" to the URL of your wiki:

    lynx --dump http://`hostname`/mywiki?action=test
    

    If you see an import error here, but "python -c "import MoinMoin"" works, it's likely a result of missing file permissions or a wrong PYTHONPATH setting within the web server environment.

    Duelling Pythons

    The most common problem you might encounter is when you have an old Python version installed into "/usr", and a newer Python distribution into "/usr/local"; this is typical for GNU/Linux distributions that still come bundled with an old Python version.

    In that case, if you enter "python" on your prompt, you will usually get the more recent Python interpreter, because "/usr/local/bin" is in your PATH. The situation is different in your webserver environment, and thus you might have to change the bang path of "moin.cgi", like this:

    #!/usr/local/bin/python
    
    """
        MoinMoin - CGI Driver Script
    ...
    """
    

    Missing file permissions

    If you are root, the installed files may be readable only by root, but they must also be readable by the web server before the wiki will work. This includes both the Python modules and the site itself. For the data directory, the wiki engine also needs write access. To fix this, first find out where the Python module directory is; look in install.log, or run the command:

    python -c "import sys; print '%s/lib/python%s/site-packages' % ( sys.prefix, sys.version[:3] )"
    

    For the example below, we'll assume that the Python module directory is /usr/local/lib/python2.3/site-packages. Make the files world-readable using the following commands:

    cd /usr/local
    chmod -R a+rX lib/python2.3/site-packages/MoinMoin
    

    last modified 2004-10-31 06:00:34