~ubuntu-branches/ubuntu/oneiric/moin/oneiric-security

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-03-30 12:55:34 UTC
  • mfrom: (0.1.17 sid)
  • Revision ID: james.westby@ubuntu.com-20100330125534-4c2ufc1rok24447l
Tags: 1.9.2-2ubuntu1
* Merge from Debian testing (LP: #521834). Based on work by Stefan Ebner.
  Remaining changes:
 - Remove python-xml from Suggests field, the package isn't anymore in
   sys.path.
 - Demote fckeditor from Recommends to Suggests; the code was previously
   embedded in moin, but it was also disabled, so there's no reason for us
   to pull this in by default currently. Note: This isn't necessary anymore
   but needs a MIR for fckeditor, so postpone dropping this change until
   lucid+1
* debian/rules:
  - Replace hardcoded python2.5 with python* and hardcore python2.6 for ln
* debian/control.in: drop versioned depends on cdbs

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
 
If you're running Apache 1.3 (or an httpd based on Apache 1.3, such as OpenBSD's httpd), it's still possible to get MoinMoin working under WSGI.  It will take some additional steps.  These instructions assume you have root (superuser) privileges on the wiki server, and a dedicated virtual host name that you will use for your wiki (e.g. `mywiki.your.domain`).
9
 
 
10
 
Before we start, you should take note of your ''wiki directory'' (something like `/var/www/moin/mywiki`) and your ''wiki user'' (something like `www` or `www-data` -- whatever account owns the wiki directory and its content).
11
 
 
12
 
 1. Install [[http://www.cherrypy.org/|CherryPy]] on the wiki server.
13
 
 
14
 
 1. Copy `moin.wsgi` from the `wiki/server/` subdirectory of the source tree into your wiki directory.  Edit it:
15
 
 {{{#!python
16
 
#!/usr/bin/env python
17
 
# -*- coding: iso-8859-1 -*-
18
 
"""
19
 
    MoinMoin - mod_wsgi driver script
20
 
    ...
21
 
"""
22
 
 
23
 
from MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp
24
 
from cherrypy.wsgiserver import CherryPyWSGIServer, WSGIPathInfoDispatcher
25
 
 
26
 
class Config(WsgiConfig):
27
 
    pass
28
 
 
29
 
config = Config()
30
 
 
31
 
application = moinmoinApp
32
 
 
33
 
def run_cherrypy(app, address='', port=8080):
34
 
    from cherrypy import wsgiserver
35
 
    d = WSGIPathInfoDispatcher({'/': app})
36
 
    server = CherryPyWSGIServer((address, port), d,
37
 
                                server_name='mywiki.your.domain')
38
 
    try:
39
 
        server.start()
40
 
    except KeyboardInterrupt:
41
 
        server.stop()
42
 
 
43
 
run_cherrypy(application, '0.0.0.0', 8080)
44
 
 }}}
45
 
 Change the `server_name=` part and the port number, if you want.  You may use any port number greater than 1023 that's not already being used by something else.  (We'll be running this program as an unprivileged user, so we can't use ports under 1024.)  Give it execute permissions with a `chmod 755 moin.wsgi` command.
46
 
 
47
 
 1. Arrange for the `moin.wsgi` program to be run as your wiki user, inside the wiki directory, according to whatever techniques you use on your system for boot scripts or the like.  Start it running now.  You should see it listening on port 8080 (or whatever you set in the `moin.wsgi` file).
48
 
 
49
 
 1. Edit your Apache configuration (`httpd.conf` or whatever filename is correct for your system):
50
 
 {{{
51
 
...
52
 
Alias /moin_static183/ "/usr/local/share/moin/htdocs/"
53
 
...
54
 
NameVirtualHost *:80
55
 
...
56
 
<VirtualHost *:80>
57
 
ServerName mywiki.your.domain
58
 
ServerAdmin your@email.address
59
 
RewriteEngine On
60
 
RewriteCond %{REQUEST_URI} !^/moin_static.../
61
 
RewriteRule ^/(.*) http://127.0.0.1:8080/$1 [P]
62
 
ProxyRequests Off
63
 
ProxyPassReverse / http://127.0.0.1:8080/
64
 
ErrorLog /var/www/logs/mywiki.your.domain-error.log
65
 
CustomLog /var/www/logs/mywiki.your.domain-access.log combined
66
 
</VirtualHost>
67
 
 }}}
68
 
 Obviously, you should change the `htdocs` location, the port number, and the logfile locations as necessary.
69
 
 
70
 
 The `moin_static183` in the `Alias` should be changed for each version of MoinMoin.  The `moin_static...` part in the `RewriteCond` is a regular expression, so it will match every version, and doesn't need adjustment.  The purpose of the rewriting code here
71
 
 is to allow the Alias to work for the static content URLs, and rewrite (proxy) everything else to the CherryPy service.
72
 
 
73
 
 Reload or restart your Apache so that it picks up the changes.
74
 
 
75
 
That's basically all.  Your wiki should be visible at `http://mywiki.your.domain/` now.  Test everything and make sure it seems correct.