Configuring root wiki

You may wish to have your wiki appearing at the root of your webserver - for example so that http://wiki.example.com/ will map to your wiki rather than having to use http://wiki.example.com/mywiki/. This requires a slightly different form of configuration using mod_rewrite - this is a standard module of recent Apache distributions, and is often enabled by default.

You need to set up your wiki instance as described above, and also copy moinmodpy.py from the Moin installation directory to the wiki instance directory (/var/www/moin/mywiki in these examples).

The Apache configuration needs mod_rewrite enabled - so the line

LoadModule rewrite_module modules/mod_rewrite.so

should appear in the first part of the httpd.conf configuration file.

The wiki and virtual host configuration should look like this (Alias is for moin version 1.6.0):-

<VirtualHost *:80>
  ServerAdmin postmaster@example.com
  DocumentRoot /var/www/html
  ServerName wiki.example.com
  Alias /moin_static160/ "/usr/share/moin/htdocs/"

  # Rewrite urls
  RewriteEngine On
  RewriteLogLevel 0
  # map /wiki static files to Moin htdocs
  RewriteRule ^/moin_static160/(.*)$ /usr/share/moin/htdocs/$1 [last]
  RewriteRule ^/robots.txt$ /usr/share/moin/htdocs/robots.txt [last]
  RewriteRule ^/favicon.ico$ /usr/share/moin/htdocs/favicon.ico [last]
  # map everything else to server script
  RewriteRule ^(.*)$ /var/www/moin/mywiki/moinmodpy.py$1

  <Directory "/var/www/moin/testwiki">
    # Modpy stuff
    AddHandler python-program .py
    # Add the path to the wiki directory, where
    # moinmodpy.py and wikiconfig.py are located.
    PythonPath "['/var/www/moin/mywiki'] + sys.path"
    PythonHandler MoinMoin.request.request_modpython::Request.run
  </Directory>
</VirtualHost>

Apache should be restarted, and the FrontPage of mywiki should now appear at http://wiki.example.com/.

Other ways of handling root level wikis with Apache are detailed in the appropriately named HelpOnConfiguration/ApacheVoodoo.