HelpContents > HelpOnAdministration > HelpOnConfiguration



  1. Configuration of MoinMoin
    1. Configuration of a single wiki
    2. Configuration of multiple wikis
    3. Overview of configuration options
    4. Default front page
    5. Changing character sets
    6. File attachments

Configuration of MoinMoin

Configuration of a single wiki

If you run a single wiki only, you should not use the file, remove it from your configuration directory. Moin will then use a built-in list [("wikiconfig", r".*")] that matches every request to the config file

A single MoinMoin wiki is configured by changing the file, which normally sits besides your moin.cgi driver script. is imported by the MoinMoin main code early in a request cycle and is found because the current directory (i.e. that of moin.cgi) is part of the Python system path. Consequently, can sit anywhere in your PYTHONPATH.

from MoinMoin.multiconfig import DefaultConfig
class Config(DefaultConfig):
    sitename = 'MyWiki'
    interwikiname = 'MyWiki'
    data_dir = '/where/ever/mywiki/data/'
    underlay_dir = '/where/ever/mywiki/underlay/'
    # ...


Configuration of multiple wikis

The moinmoin wiki engine is capable of handling multiple wikis using a single installation, a single set of configuration files and a single server process. Especially for persistent environments like twisted, this is necessary, because the twisted server will permanently run on a specific IP address and TCP port number. So for virtual hosting of multiple domains (wikis) on the same IP and port, we need the wiki engine to permanently load multiple configs at the same time and choose the right of them when handling a request for a specific URL.

To be able to choose the right config, moin uses config variable wikis located in the file - it simply contains a list of pairs (wikiname, url-regex). When processing a request for some URL, moin searches through this list and tries to match the url-regex against the current URL. If it doesn't match, it simply proceeds to the next pair. If it does match, moin loads a configuration file named <wikiname>.py (usually from the same directory) that contains the configuration for that wiki. Internally, moin adds a catch all ('wikiconfig', '.*') to the end of that list, so you do not need something like this in farmconfig.wikis. in the distribution archive has some sample entries for a wiki farm running multiple wikis, you need to adapt it to match your needs, if you want to run multiple wikis.

/!\ For simpler writing of these help pages, we will call such a <wikiname>.py configuration file simply, of course you have to edit the filename you chose.

Of course you have already adapted farmconfig.wikis (see above), so we only give some hints how you can save some work. Please also read the single wiki configuration hints, because it explains config inheritance.

We now use the class-based configuration to be able to configure the common settings of your wikis at a single place: in the base configuration class (see for an example).

The configs of your individual wikis then only keep the settings that need to be different (like the logo, or the data directory or ACL settings). Everything else they get by inheriting from the base configuration class, see for a sample.

from MoinMoin.multiconfig import DefaultConfig
class FarmConfig(DefaultConfig):
    url_prefix = '/wiki'
    show_hosts = 1
    underlay_dir = '/where/ever/common/underlay'
    # ...


from farmconfig import FarmConfig
class Config(FarmConfig):
    show_hosts = 0
    sitename = 'MoinMaster'
    interwikiname = 'MoinMaster'
    data_dir = '/org/de.wikiwikiweb.moinmaster/data/'
    # ...


Overview of configuration options

The following table contains default values and a short description for all configuration variables. Most of these can be left at their defaults, those you need to change with every installation are listed in the sample that comes with the distribution.

Variable name





class object hook for implementing security restrictions

acl_enabled (& acl_...)


true to enable Access Control Lists - fine grained page access rights settings (see HelpOnAccessControlLists)



true to enable ["non-standard wikiname"] markup



if true, numeric entities like &#8364; for € are not escaped, but &amp; and stuff still is



true to enable XSLT processing via 4Suite (note that this enables anyone with enough know-how to insert arbitrary HTML into your wiki, which is why it defaults to 0)



allow unsafe actions (list of strings)



If None, send attachments via CGI; else this has to be a dictionary with the path to attachment storage (key dir) and the equivalent URL prefix to that same dir (key url)



true to enable moin using the username of a user already authenticated by http basic auth



true to enable `inline literal` markup



true to enable !NoWikiName markup



output formats that are cached; set to [] to turn off caching (useful for development)



Time format used on RecentChanges for page edits within the last 24 hours



if you have gdchart, use something like chart_options = {'width': 720, 'height': 540}



12 hours from now until the MoinMoin cookie expires and you get logged out



Path to the data directory containing your (locally made) wiki pages.



Path to the underlay directory containing distribution system and help pages.



System date format, used mostly in RecentChanges


'%Y-%m-%d %H:%M:%S'

Default format for dates and times (when the user has no preferences or chose the "default" date format)



default language for user interface and page content, see HelpOnLanguages!



Default page parser / format (name of module in MoinMoin.parser)


'warn 10'

Editor locking policy: None, 'warn <timeout in minutes>', or 'lock <timeout in minutes>'



Default height of the edit box



List of denied IPs; if an IP ends with a dot, it denies a whole subnet (class A, B or C)


Additional <HEAD> tags for all pages (see HelpOnSkins)



Allows you to set a specific HTML page title (if not set, it defaults to the value of sitename)



InterWiki name (prefix, moniker) of the site, or None



Used to show the name of the site at the top of page, HTML is allowed (<img> is possible as well)



From: header used in sent mails



"user pwd" if you need to use SMTP AUTH



IP or domain name of an SMTP-enabled server; note that email features (notification, mailing of login data) works only if this variable is set


list of default quick links

Most important links in text form (these links can be over-ridden by the user's quick links); to link to any URL, use a free-form link of the form "[url text]"



Default for displaying WantedPages with a question mark, like in the original wiki (changeable by the user)



Pagenames containing a match for this regex are regarded as Wiki categories


MoinMoin and PythonPowered

html fragment with logos or strings for crediting



Pagenames containing a match for this regex are regarded as containing variable dictionary definitions



Custom HTML markup sent before the system footer (see HelpOnSkins)



Custom HTML markup sent after the system footer (see HelpOnSkins)



Pagenames containing a match for this regex are regarded as containing form definitions



Name of the front page (see Default front page)



Pagenames containing a match for this regex are regarded as containing group definitions



Custom HTML markup sent before the system header / title area (see HelpOnSkins)



Custom HTML markup sent after the system header / title area (see HelpOnSkins)


["view", ...]

list of icons to show in iconbar



dict of {'iconname': (url, title, icon-img-key), ...}



Show a license hint in page editor.



Page linked from the license hint.



Name of the page containing user-provided spellchecker words



Pagenames containing a match for this regex are regarded as templates for new pages



refresh = (minimum_delay_s, targets_allowed) enables use of #refresh 5 PageName processing instruction, targets_allowed must be either 'internal' or 'external'



path to a file containing global InterWiki definitions (or a list of such filenames)



true to show hostname in RecentChanges



true to show section numbers in headings by default



shows some timing values at bottom of page - used for development



show MoinMoin's version at the bottom of each page


'An Unnamed MoinMoin Wiki'

Short description of your wiki site, displayed below the logo on each page, and used in RSS documents as the channel title



the name of the theme that is used by default (see HelpOnThemes)



if True, do not allow to change the theme



Number of pages in the trail of visited pages



default time zone offset in hours from UTC



A regex of HTTP_USER_AGENTs that should be excluded from logging



lookup table to remap URL prefixes (dict of 'prefix': 'replacement'); especially useful in intranets, when whole trees of externally hosted documents move around



used as the base URL for icons, css, etc.

Some values can only be set from MoinMoin/ (part of the MoinMoin code and thus GLOBALLY changing behaviour of all your wikis), but not from the individual wiki's config - you should only touch them if you know what you are doing:



true to enable hierarchical wiki pages (see HelpOnEditing/SubPages)



the encoding / character set used by the wiki


ucs-2 lowercase letters

Lowercase letters, used to define what is a WikiName



user-defined smileys (a dict with the markup as the key and a tuple of width, height, border, image name as the value)



umask used on all open(), mkdir() and similar calls


ucs-2 uppercase letters

uppercase letters, used to define what is a WikiName



additional URL schemas you want to have recognized (list of strings)

Default front page

The default front page name, "FrontPage", is automatically translated into the user language. Thus, an English user will end up at FrontPage, while a French user will end up at PageD'Accueil.

/!\ If you have made your own front page which is suitable for all people regardless of their spoken languages, you should give it a different name (anything but "FrontPage" will do) and set the page_front_page setting to this name. For example:

page_front_page = 'MyFrontPage'

Changing character sets

Do not. By default, moin uses unicode (depending on your python, it will use either ucs-2 16bit or ucs-4 32bit chars) internally and utf-8 as external character encoding.

/!\ You should not have to change this, as any character can be encoded in utf-8. So we do not recommend changing the default. We also do not support non-utf-8 encodings, although it is technically possible:

# MoinMoin/ - this is GLOBAL for all wikis in your installation!
charset = "iso8859-1"
upperletters = "A-Z"
lowerletters = "0-9a-z"

With that setting, you need to set "allow_extended_names=1" and use the special markup for extended WikiNames ["extended name"] to get any names with characters outside the core latin alphabet.

File attachments

The [Self]AttachFile action enables a page to have multiple attached files. Since file uploads could be abused for DoS (Denial of Service) attacks, AttachFile is an action that may be enabled by the wiki administrator. To do this, add "allowed_actions = ['AttachFile']" to your configuration file.

If you wiki has (or is expected to have) many file attachments, there is an option which will eliminate the CGI overhead associated with each retrieval of an attachment file.

/!\ If you make your attachments directly accessible via the web server, you should make sure that the web server does not execute stuff (like php or asp or other scripts) uploaded by some malicious user. /!\

If you do not know how to do that, do not configure your moin like described below or you risk making your server remotely exploitable.

There are two storage/retrieval models for file attachments:

  1. Attachments are stored "privately" and can only be retrieved via a CGI GET (via URLs like<SomePage>?action=AttachFile&do=get&target=filename.ext).

  2. Attachments are stored into a directory directly accessible by the web server, and can thus be served directly by the webserver, without any invocation of MoinMoin (leading to URLs like<Somepage>/attachments/filename.ext).

If the efficiency of serving file attachments is a concern, the second option is preferable, but it also requires additional configuration steps and possibly more rights on the host machine. Because of this, the first option is the default; attachments are stored in the "...mywiki/data/pages/" directory, with paths like "...mywiki/data/pages/<pagename>/attachments/<filename>".

The MoinMoin attachments configuration option allows you to move the directory structure used to store attachments to another location. Unless you have a reason for doing so, there is no need to use a different location. Using a different location may be more work and more risk, as all the existing attachments must be copied to the new location. The following instructions are for Apache servers and assume you intend to leave the attachment files in their existing location and your original installation used the name "mywiki".

The first step is to tell Apache that it has another Alias directory from which it can serve files. Review the changes you made to the httpd.conf (or commonhttpd.conf) file during the MoinMoin installation and find the ScriptAlias statement similar to the following:

    ScriptAlias /mywiki           ".../mywiki/moin.cgi" 

Create an Alias statement similar to the ScriptAlias statement above, replacing the /mywiki URI with /mywikiattach/ and replacing moin.cgi with data/pages/.

    Alias       /mywikiattach/    ".../mywiki/data/pages/"

Be sure to note the differences in the trailing slashes between the two statements, they must be entered exactly as shown above. If you are making this change to a running system, you must restart Apache to have the change take effect.

The second step is to tell MoinMoin to let Apache do the work of fetching file attachments. To do this, you need to add an attachments option to .../mywiki/ The 'attachment' option is a dictionary of two values:

attachments = {
    'dir': '.../mywiki/data/pages',
    'url': '/mywikiattach',

MoinMoin must still do the work of uploading file attachments. The dir value above tells MoinMoin where to store attachments; note this is the same as the path in the new Apache Alias statement but without the trailing "/". The url value tells MoinMoin how to retrieve the attachments; this matches the URI in the Alias statement but again without the trailing "/".

/!\ Your attached files are now directly servable by Apache. However if you also have PHP (or ASP or any other server parsed language) installed then an attacker can upload a PHP script an then run it to exploit other local weaknesses.

For example, you can disable PHP for the appropriate directory (note that it's difficult to include instructions for disabling all server parsed languages).

<Directory .../mywiki/data/pages/>
    RemoveType .php .php3 .php4 .phtml

/!\ This only disables php stuff - you have to add everything else on your own!

After you have completed the configuration changes, test by uploading an attachment for WikiSandBox. Then modify the WikiSandBox page to display the uploaded image or download the file. If there were existing attachments before this change, verify the old attachments are still available. Finally, review the Apache access.log file to verify you have a log entry showing the expected file access:

last modified 2004-12-11 15:03:12