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

« back to all changes in this revision

Viewing changes to wiki/underlay/pages/HelpOnInstalling(2f)ApacheWithModWSGI/revisions/00000001

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mfrom: (0.9.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080622211713-fpo2zrq3s5dfecxg
Tags: 1.7.0-3
Simplify /etc/moin/wikilist format: "USER URL" (drop unneeded middle
CONFIG_DIR that was wrongly advertised as DATA_DIR).  Make
moin-mass-migrate handle both formats and warn about deprecation of
the old one.

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
##master-page:Unknown-Page
 
4
##master-date:Unknown-Date
 
5
#acl -All:write Default
 
6
#format wiki
 
7
#language en
 
8
 
 
9
<<TableOfContents>>
 
10
 
 
11
= Why use mod_wsgi? =
 
12
 
 
13
See the [[http://modwsgi.org/|mod_wsgi homepage]].
 
14
 
 
15
(!) Please note that its "daemon mode" should be the preferred way to use it (and this is the reason to prefer mod_wsgi over mod_python).
 
16
 
 
17
= Basic configuring =
 
18
 
 
19
 1. Install mod_wsgi
 
20
 1. Set up a wiki instance
 
21
 1. Edit `wikiconfig.py`
 
22
 3. Changes to Apache configuration
 
23
 1. Restart Apache
 
24
 
 
25
The sample configurations below are for a wiki instance called `mywiki` installed in a directory `/var/www/moin/mywiki` with the main !MoinMoin installation installed in python's default site library path. The wiki appears as URL `/mywiki` under the server - ie `http://my.ser.ver/mywiki`.  You will need to change these to reflect your installation.
 
26
 
 
27
== Install mod_wsgi ==
 
28
 
 
29
Most people will just add a `mod_wsgi` package to their current operating system installation.  If you are building from source then you should consult the mod_wsgi documentation (it is rather easy if you have a development environment installed).
 
30
 
 
31
Make sure you have this line in your apache configuration or mod_wsgi will not work:
 
32
{{{
 
33
LoadModule wsgi_module modules/mod_wsgi.so
 
34
}}}
 
35
 
 
36
After this restart Apache and make sure that it starts successfully (also check the the error log).
 
37
 
 
38
== Set up a wiki instance ==
 
39
 
 
40
This is done as shown in [[HelpOnInstalling/WikiInstanceCreation|WikiInstanceCreation]]. Its recommended to first configure the wiki with cgi and check that it works, then change the configuratin to use mod_wsgi. This allows you be sure that any problems are in the mod_wsgi transition rather than the basic MoinMoin installation.
 
41
 
 
42
 1. Copy moin.cgi into your wiki directory
 
43
 1. Configure `httpd.conf` as cgi first (Alias shown is for 1.7.0, for other versions please change it):
 
44
  {{{
 
45
Alias /moin_static170/ "/usr/share/moin/htdocs/"
 
46
ScriptAlias /mywiki "/var/www/moin/mywiki/moin.cgi"
 
47
}}}
 
48
 
 
49
Restart Apache and make test that your wiki works.
 
50
 
 
51
== Edit `wikiconfig.py` ==
 
52
 
 
53
Make sure you use only absolute paths:
 
54
{{{
 
55
data_dir = '/var/www/moin/mywiki/data/'
 
56
data_underlay_dir = '/var/www/moin/mywiki/underlay/'
 
57
}}}
 
58
 
 
59
Test that the wiki works after this change.
 
60
 
 
61
== Changes to Apache configuration ==
 
62
 
 
63
After your wiki is running as cgi script, convert it to run with mod_wsgi. 
 
64
 
 
65
If you run your wiki as cgi as we recommended before, remove or comment the !ScriptAlias directive:
 
66
{{{
 
67
#ScriptAlias /mywiki "/var/www/moin/mywiki/moin.cgi"
 
68
}}}
 
69
 
 
70
Add this to the same virtualhost definition (Alias shown is for 1.7.0, for other versions please change it):
 
71
{{{
 
72
    # this is for icons, css, js (and must match url_prefix from wiki config):
 
73
    Alias /moin_static170/ /usr/share/moin/htdocs/
 
74
 
 
75
    # this is the URL http://servername/mywiki/ you will use later to invoke moin:
 
76
    WSGIScriptAlias /mywiki /var/www/moin/mywiki/moin.wsgi
 
77
 
 
78
    # in case you want your wiki under the root url (http://servername/), use this instead:
 
79
    #Alias /robots.txt /usr/share/moin/htdocs/robots.txt
 
80
    #Alias /favicon.ico /usr/share/moin/htdocs/favicon.ico
 
81
    #WSGIScriptAlias / /var/www/moin/mywiki/moin.wsgi
 
82
 
 
83
    # create some wsgi daemons - use someuser.somegroup same as your data_dir:
 
84
    WSGIDaemonProcess moin user=someuser group=somegroup home=/home/someuser processes=5 threads=10 maximum-requests=1000 umask=0007
 
85
    # for mod_wsgi >= 2.0 you can append this to have a nice ps aux display:
 
86
    # display-name=wsgi-moin
 
87
 
 
88
    # use the daemons we defined above to process requests!
 
89
    WSGIProcessGroup moin
 
90
}}}
 
91
 
 
92
Please also have a look into `moin.wsgi` - you maybe have to change some `sys.path.insert` instructions so Python can find the !MoinMoin code and the wiki configuration.
 
93
 
 
94
Restart Apache - everything should now work correctly.