~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to wiki/underlay/pages/HelpOnConfiguration(2f)ApacheVoodoo/revisions/00000001

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## Please edit system and help pages ONLY in the master wiki!
 
2
## For more information, please see MoinMoin:MoinDev/Translation.
 
3
## page was renamed from ApacheVoodoo
 
4
##master-page:Unknown-Page
 
5
##master-date:Unknown-Date
 
6
#acl -All:write Default
 
7
#format wiki
 
8
#language en
 
9
 
 
10
<<TableOfContents>>
 
11
 
 
12
/!\ Voodoo is not for newbies!
 
13
 
 
14
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.
 
15
 
 
16
 
 
17
= Apache Root Wiki =
 
18
 
 
19
/!\ This requires the Apache module "mod_rewrite" (which should be standard)
 
20
 
 
21
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 WikiName namespace.
 
22
 
 
23
 1. Install moin as normal.
 
24
 1. Add the following lines to your VirtualHost config:
 
25
  {{{
 
26
  RewriteEngine On
 
27
  RewriteLogLevel 0
 
28
  
 
29
  # Point to moin shared static files - DEPENDS ON MOIN VERSION!
 
30
  RewriteRule ^/moin_static160/(.*)$ /prefix/share/moin/htdocs/$1 [last]
 
31
  
 
32
  # Map everything else to moin cgi script
 
33
  RewriteRule ^(.*)$ /path/to/moin.cgi$1 [type=application/x-httpd-cgi]
 
34
  
 
35
  # Setting for FastCGI
 
36
  ##RewriteRule ^(.*)$ /path/to/moin.fcg$1 [type=application/x-httpd-fcgi]
 
37
}}}
 
38
 
 
39
The RewriteRule for Fast''''''CGI here does not work for me: {{{
 
40
[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
 
41
duplo:/home/danielt# ls /home/apache/moin/wiki/share/moin/pw/moin.fcg
 
42
-rwxr-xr-x  1 root  www  1088 Jan  4 23:35 /home/apache/moin/wiki/share/moin/pw/moin.fcg*
 
43
}}}
 
44
 
 
45
As a workaround I use this: {{{
 
46
  RewriteRule ^/?(.*) /_Wikiscript_/moin.fcg/$1
 
47
  RewriteRule ^/_Wikiscript_/(.*) /home/apache/moin/wiki/share/moin/pw/$1 [last]
 
48
}}}
 
49
 
 
50
 
 
51
= Root wiki on Mac OSX =
 
52
/!\ This configuration intercepts all userfolder URLs like ''`http://127.0.0.1/~yourname/`'' 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.
 
53
 
 
54
Using the previous information on the moin OS X installation, you end up with a virtual host block like this:
 
55
{{{
 
56
<VirtualHost *>
 
57
   ServerName Gnarlodious
 
58
   Alias /moin_static160/ /usr/local/share/moin/htdocs/
 
59
   ScriptAlias /mywiki /usr/local/share/moin/mywiki/moin.cgi
 
60
   RewriteEngine On
 
61
   RewriteRule ^/moin_static160/(.*)$ /usr/local/share/moin/htdocs/$1 [last]
 
62
   RewriteRule ^(.*)$ /usr/local/share/moin/mywiki/moin.cgi$1 [type=application/x-httpd-cgi]
 
63
</VirtualHost> 
 
64
}}}
 
65
Remove the following `<IfModule mod_alias.c>` directives added on [[HelpOnInstalling/ApacheOnMacOsx|this page]], as they are now redundant:
 
66
{{{
 
67
    Alias /moin_static160/ "/moinwiki/share/moin/htdocs/"
 
68
    ScriptAlias /mywiki "/moinwiki/share/moin/mywiki/moin.cgi"
 
69
}}}
 
70
Now restart Apache. You should be able to open a URL like http://127.0.0.1/HelpOnInstalling/ApacheOnMacOsx
 
71
 
 
72
 
 
73
= Root wiki with mod python recipe =
 
74
 
 
75
Using the above example, I got this working like this:
 
76
 
 
77
 1. Install moin as usual and create instance
 
78
 1. Use this config in httpd.conf
 
79
  {{{
 
80
NameVirtualHost 192.115.134.51:80
 
81
<VirtualHost 192.115.134.51:80>
 
82
    ServerName wiki.nirs.dyndns.org
 
83
    ServerAlias wiki
 
84
    
 
85
    # Rewrite urls
 
86
    RewriteEngine On
 
87
    RewriteLogLevel 0
 
88
    # map static files to htdocs
 
89
    RewriteRule ^/moin_static160/(.*)$ /usr/share/moin/htdocs/$1 [last]
 
90
    # map everything else to server script
 
91
    RewriteRule ^(.*)$ /usr/share/moin/mywiki/moinmodpy.py$1
 
92
 
 
93
    <Directory "/usr/share/moin/mywiki">
 
94
        # These are copied from the default cgi-bin directory
 
95
        AllowOverride None
 
96
        Options None
 
97
        Order allow,deny
 
98
        Allow from all
 
99
 
 
100
        # Modpy stuff
 
101
        AddHandler python-program .py
 
102
        # Add the path to the wiki directory, where moinmodpy.py and 
 
103
        # wikiconfig.py are located.
 
104
        PythonPath "['/usr/share/moin/mywiki'] + sys.path"
 
105
        PythonHandler moinmodpy
 
106
        PythonDebug On 
 
107
    </Directory>
 
108
</VirtualHost>
 
109
}}}
 
110
 
 
111
(!) It seems to be impossible to get a root modpy wiki without using the moinmodpy wrapper script.