Package: moin Version: 1.9.1-1 Severity: wishlist Hi,
Find attached a patch to make it easier to setup MoinMoin. It is merely and configuration snippet for Apache that a user can symlink in /etc/apache2/conf/ (or include in a vhost). It provides: 1. An alias to serve moinmoin as http://thehost/wiki/ (WSGI or CGI is used depending on the Apache module enabled) 2. An alias for "moin_static191" content (Using a regular expression, so users don't have for update the version number when the wiki is upgraded) 3. An alias for fckeditor (It doesn't hurt if fckeditor isn't installed) This patch isn't finalized yet, but your comments are welcome. Franklin
commit 3acf31b94c55b0c5c0cd371e131922171c20075f Author: Frank Lin PIAT <fp...@klabs.be> Date: Mon Feb 15 01:04:26 2010 +0100 Update README to document WSGI (with apache snippet) diff --git a/debian/README.Debian.in b/debian/README.Debian.in index ad8ed4b..a1d7618 100644 --- a/debian/README.Debian.in +++ b/debian/README.Debian.in @@ -5,8 +5,8 @@ This Debian package has been tested mostly as WSGI and as CGI script with Apache 2.2 (It should work with any web server supporting either of these: WSGI, FCGI, FastCGI, SCGI, CGI) -Example: A single wiki as CGI with Apache2 ------------------------------------------- +Example: A single wiki as WSGI with Apache2 +------------------------------------------- 1) Create and populate /var/www/mywiki # mkdir /var/www/mywiki @@ -14,18 +14,10 @@ Example: A single wiki as CGI with Apache2 # cp -r /usr/share/moin/data /usr/share/moin/underlay /var/lib/mywiki 2) Pass on the wiki to Apache: - # chown -R www-data: /var/www/mywiki /var/lib/mywiki + # chown -R www-data: /var/lib/mywiki 3) Configure Apache2: - Add the following as /etc/apache2/sites-available/mywiki: - - <VirtualHost *:80> - ServerName wiki.example.org - DocumentRoot /var/www/mywiki/ - Alias __STATICPATH__/applets/FCKeditor/ "/usr/share/fckeditor/" - Alias __STATICPATH__/ "/usr/share/moin/htdocs/" - ScriptAlias /MyWiki "/usr/share/moin/server/moin.cgi" - </VirtualHost> + # ln -s ../../moin/apache-snippet.conf /etc/apache2/conf.d/moinmoin.conf 4) Configure MoinMoin: Edit /etc/moin/mywiki.py to include these lines: @@ -37,17 +29,13 @@ Example: A single wiki as CGI with Apache2 Edit /etc/moin/wikilist to include this line: - www-data wiki.example.org/ - - 5) Activate wiki: - # a2ensite mywiki - # invoke-rc.d apache2 reload + www-data www.example.org/wiki - 6) Visit your new wiki at http://your.site/MyWiki/LanguageSetup + 5) Visit your new wiki at http://www.example.org/wiki/LanguageSetup then create you account (name according to the superuser you specified above). - 7) Install the language pack you want to use (typically, you want to install + 6) Install the language pack you want to use (typically, you want to install the "all_pages" pack in English, plus the languages use in your wiki). @@ -171,3 +159,4 @@ more on http://moinmo.in/MoinMoinDependencies -- Jonas Smedegaard <d...@jones.dk> Tue, 22 Mar 2005 03:05:47 +0100 + diff --git a/debian/apache-no-gi.txt b/debian/apache-no-gi.txt new file mode 100644 index 0000000..6129566 --- /dev/null +++ b/debian/apache-no-gi.txt @@ -0,0 +1,3 @@ +If you see this text, Apache isn't configured properly for moinmoin. +You should enable a gateway interface module in apache (WSGI, CGI...) +(typically, "a2enmod wsgi"). diff --git a/debian/apache-snippet.conf b/debian/apache-snippet.conf new file mode 100644 index 0000000..184eac0 --- /dev/null +++ b/debian/apache-snippet.conf @@ -0,0 +1,67 @@ +# Apache configuration fragment for moinmoin. +# (It's usually symlinked in /etc/apache2/conf.d/ so it's available for +# all vhost. Alternatively it is possible to use it in a specific vhost +# using "Include /etc/moin/apache2.conf") +# see moinmoin's README.Debian for more information + + +### Serve static contents (images, javascript, css...) ### + +AliasMatch "^/moin_static[0-9]*/applets/FCKeditor/(.*)" "/usr/share/fckeditor/$1" +<Directory "/usr/share/fckeditor/"> + Options None + AllowOverride None + <IfModule mod_expires.c> + ExpiresActive On + ExpiresDefault "access plus 4 hour" + </IfModule> +</Directory> + +# The path to static contents changes (named after moinmoin version). +AliasMatch "^/moin_static[0-9]*/(.*)" "/usr/share/moin/htdocs/$1" +<Directory "/usr/share/moin/htdocs/"> + Options -Indexes -FollowSymlinks + AllowOverride None + <IfModule mod_expires.c> + ExpiresActive On + ExpiresDefault "access plus 4 hour" + </IfModule> +</Directory> + +### vhost ### +# Alias /robots.txt /usr/share/moin/htdocs/robots.txt +# Alias /favicon.ico /usr/share/moin/htdocs/favicon.ico + +### Serve the wiki as /wiki ### + +# Automatically use the best available request handler (WSGI/CGI). +# print an error message if none is available. +<IfModule mod_wsgi.c> + #WSGIDaemonProcess mywiki user=mywiki group=mywiki processes=4 display-name=moin-wsgi-mywiki + #WSGIProcessGroup mywiki + WSGIScriptAlias /wiki "/usr/share/moin/server/moin.wsgi" + # Read: http://moinmo.in/HowTo/ApacheWithModWSGI +</IfModule> +<IfModule !mod_wsgi.c> + <IfModule mod_cgi.c> + ScriptAlias /wiki "/usr/share/moin/server/moin.cgi" + </IfModule> + + <IfModule !mod_cgi.c> + AliasMatch "/wiki.*" "/usr/share/moin/htdocs/apache-no-gi.txt" + <IfModule mod_expires.c> + <Directory /usr/share/moin/htdocs/> + <Files apache-no-gi.txt> + ExpiresActive Off + </Files> + </Directory> + </IfModule> + </IfModule> +</IfModule> + +<Directory "/usr/share/moin/server/"> + Options -Indexes -FollowSymlinks + AllowOverride None +</Directory> + +# vim: ts=4 ft=apache diff --git a/debian/install b/debian/install index 8693046..86cfacd 100644 --- a/debian/install +++ b/debian/install @@ -1,3 +1,5 @@ debian/moin-mass-migrate /usr/sbin/ debian/moin-update-wikilist /usr/bin/ debian/wikilist /etc/moin/ +debian/apache-snippet.conf /etc/moin/ +debian/apache-no-gi.txt /usr/share/moin/htdocs/