Configuring moin.py

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:

import sys
sys.path.insert(0, '/path/to/moin')
sys.path.insert(0, '/path/to/wikiconfig')

Config class options

Option

Default

Comment

name

'moin'

Server name, used by default for log and pid files. (!) New in 1.5

docs

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

Path to moin shared files. If you used --prefix install, the default path will not work, and you must set the path to 'PREFIX/share/moin/wiki/htdocs'.

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

8000

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

interface

'localhost'

The interface the server will listen to. The default will listen only to localhost. Set to '' to listen to all.

logPath

name + '.log'

Log file. Default is commented.

serverClass

'ThreadPoolServer', 'ThreadingServer', 'ForkingServer', 'SimpleServer', 'SecureThreadPoolServer'

The server type to use, see the comments in the moin.py. The default is 'ThreadPoolServer', which create a pool of threads and reuse them for new connections. (!) New in 1.3.5

threadLimit

10

How many threads to create.

requestQueueSize

50

The count of socket connection requests that are buffered by the operating system. (!) New in 1.3.5

properties

 {} 

allow overriding any request property by setting the value in this dict e.g properties = {'script_name': '/mywiki'}. (!) New in 1.5

ssl_privkey

 None 

If using the SecureThreadPoolServer, this must point to the server's private key (!) New in 1.6

ssl_certificate

 None 

If using the SecureThreadPoolServer, this must point to the server's certificate (!) New in 1.6

Using the secure standalone server

(!) New in 1.6

The standalone server supports SSL when using the SecureThreadPoolServer server class. The SSL support is provided by the TLSLite library. All wiki traffic is forced to SSL when using the SecureThreadPoolServer.

Two additional configuration options are required when using the SecureThreadPoolServer. First, ssl_privkey must point to the server's private key. Second, ssl_certificate must point to the server's certificate.

/!\ TLSLite does not support a password protected private key unless additional libraries are used. Consult the TLSLite webpage for more information.

Typically a certificate would be purchased from an certificate authority, such as Thawte (http://www.thawte.com). However, since the suggested usage of the standalone server is for personal use, a self signed certificate may be appropriate. For more information on how to generate a server private key, and a self signed certificate, see the openssl HOWTO pages.

For example, to create the server's private key, run the following:

openssl genrsa -out privkey.pem 2048

To create a self signed certificate for the newly created private key, run the following:

openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095

moin.py then needs to be told about the generated files privkey.pem and cacert.pem. For the example above, the following lines would need to be added to moin.py:

    ssl_privkey = "/secure/path/to/privkey.pem"
    ssl_certificate = "/secure/path/to/cacert.pem"

/!\ Using a self signed certificate will cause your browser to generate a warning that it cannot verify the identify of the wiki server. This is because the certificate was not signed by a recognized certificate authority (CA). In order to get rid of this warning, you must purchase a certificate from a CA.