<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>HelpOnConfiguration/ApacheVoodoo</title></articleinfo><para><inlinemediaobject><imageobject><imagedata depth="15" fileref="http://www.nnx.me//moin_static197/ninuxtheme02/img/alert.png" width="15"/></imageobject><textobject><phrase>/!\</phrase></textobject></inlinemediaobject> Voodoo is not for newbies! </para><para>This page gives some nice but advanced tricks for a moin Apache setup. The directives on this page assume that you have knowledge about Apache configuration, newbies should stick to the basic setup. </para><section><title>Apache Root Wiki</title><para><inlinemediaobject><imageobject><imagedata depth="15" fileref="http://www.nnx.me//moin_static197/ninuxtheme02/img/alert.png" width="15"/></imageobject><textobject><phrase>/!\</phrase></textobject></inlinemediaobject> This requires the Apache module &quot;mod_rewrite&quot; (which should be standard) </para><para>An Apache root wiki is easy, but it has limitations. Since moin needs to access certain static files (images, css, etc.), it intercepts a part of the possible <ulink url="http://www.nnx.me/HelpOnConfiguration/ApacheVoodoo/WikiName#">WikiName</ulink> namespace. </para><orderedlist numeration="arabic"><listitem><para>Install moin as normal. </para></listitem><listitem><para>Add the following lines to your <ulink url="http://www.nnx.me/HelpOnConfiguration/ApacheVoodoo/VirtualHost#">VirtualHost</ulink> config: </para><itemizedlist><listitem override="none"><screen><![CDATA[  RewriteEngine On
  RewriteLogLevel 0
  
  # Point to moin shared static files - DEPENDS ON MOIN VERSION!
  RewriteRule ^/moin_static160/(.*)$ /prefix/share/moin/htdocs/$1 [last]
  
  # Map everything else to moin cgi script
  RewriteRule ^(.*)$ /path/to/moin.cgi$1 [type=application/x-httpd-cgi]
  
  # Setting for FastCGI
  ##RewriteRule ^(.*)$ /path/to/moin.fcg$1 [type=application/x-httpd-fcgi]]]></screen></listitem></itemizedlist></listitem></orderedlist><para>The <ulink url="http://www.nnx.me/HelpOnConfiguration/ApacheVoodoo/RewriteRule#">RewriteRule</ulink> for Fast<emphasis role="strong"/>CGI here does not work for me: </para><screen><![CDATA[[Wed Jan 05 01:43:41 2005] [error] [client 10.0.0.1] File does not exist: /home/apache/moin/wiki/share/moin/pw/moin.fcg/RecentChanges, referer: http://moin.dahoam/StartSeite
duplo:/home/danielt# ls /home/apache/moin/wiki/share/moin/pw/moin.fcg
-rwxr-xr-x  1 root  www  1088 Jan  4 23:35 /home/apache/moin/wiki/share/moin/pw/moin.fcg*]]></screen><para>As a workaround I use this: </para><screen><![CDATA[  RewriteRule ^/?(.*) /_Wikiscript_/moin.fcg/$1
  RewriteRule ^/_Wikiscript_/(.*) /home/apache/moin/wiki/share/moin/pw/$1 [last]]]></screen></section><section><title>Root wiki on Mac OSX</title><para><inlinemediaobject><imageobject><imagedata depth="15" fileref="http://www.nnx.me//moin_static197/ninuxtheme02/img/alert.png" width="15"/></imageobject><textobject><phrase>/!\</phrase></textobject></inlinemediaobject> This configuration intercepts all userfolder URLs like <emphasis><code>http://127.0.0.1/~yourname/</code></emphasis> and offers a blank wiki page instead, so these instructions are offered as an exercise only. There may be a way around this problem but I don't know what it is. </para><para>Using the previous information on the moin OS X installation, you end up with a virtual host block like this: </para><screen><![CDATA[<VirtualHost *>
   ServerName Gnarlodious
   Alias /moin_static160/ /usr/local/share/moin/htdocs/
   ScriptAlias /mywiki /usr/local/share/moin/mywiki/moin.cgi
   RewriteEngine On
   RewriteRule ^/moin_static160/(.*)$ /usr/local/share/moin/htdocs/$1 [last]
   RewriteRule ^(.*)$ /usr/local/share/moin/mywiki/moin.cgi$1 [type=application/x-httpd-cgi]
</VirtualHost> ]]></screen><para>Remove the following <code>&lt;IfModule mod_alias.c&gt;</code> directives added on <ulink url="http://www.nnx.me/HelpOnConfiguration/ApacheVoodoo/HelpOnInstalling/ApacheOnMacOsx#">this page</ulink>, as they are now redundant: </para><screen><![CDATA[    Alias /moin_static160/ "/moinwiki/share/moin/htdocs/"
    ScriptAlias /mywiki "/moinwiki/share/moin/mywiki/moin.cgi"]]></screen><para>Now restart Apache. You should be able to open a URL like <ulink url="http://127.0.0.1/HelpOnInstalling/ApacheOnMacOsx"/> </para></section><section><title>Root wiki with mod python recipe</title><para>Using the above example, I got this working like this: </para><orderedlist numeration="arabic"><listitem><para>Install moin as usual and create instance </para></listitem><listitem><para>Use this config in httpd.conf </para><itemizedlist><listitem override="none"><screen><![CDATA[NameVirtualHost 192.115.134.51:80
<VirtualHost 192.115.134.51:80>
    ServerName wiki.nirs.dyndns.org
    ServerAlias wiki
    
    # Rewrite urls
    RewriteEngine On
    RewriteLogLevel 0
    # map static files to htdocs
    RewriteRule ^/moin_static160/(.*)$ /usr/share/moin/htdocs/$1 [last]
    # map everything else to server script
    RewriteRule ^(.*)$ /usr/share/moin/mywiki/moinmodpy.py$1
]]><![CDATA[
    <Directory "/usr/share/moin/mywiki">
        # These are copied from the default cgi-bin directory
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
]]><![CDATA[
        # Modpy stuff
        AddHandler python-program .py
        # Add the path to the wiki directory, where moinmodpy.py and 
        # wikiconfig.py are located.
        PythonPath "['/usr/share/moin/mywiki'] + sys.path"
        PythonHandler moinmodpy
        PythonDebug On 
    </Directory>
</VirtualHost>]]></screen></listitem></itemizedlist></listitem></orderedlist><para><inlinemediaobject><imageobject><imagedata depth="16" fileref="http://www.nnx.me//moin_static197/ninuxtheme02/img/idea.png" width="16"/></imageobject><textobject><phrase>(!)</phrase></textobject></inlinemediaobject> It seems to be impossible to get a root modpy wiki without using the moinmodpy wrapper script. </para></section></article>