annotate wiki/server/moin.wsgi @ 3105:80e1a910a2f1

make logging more configurable and flexible, packages/modules shall call MoinMoin.server.getLogger
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 23 Feb 2008 21:43:47 +0100
parents 8d21b13482e3
children c6e39279f83b
rev   line source
2972
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
2 """
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
3 MoinMoin - mod_wsgi driver script
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
5 To use this, add those statements to your Apache's VirtualHost definition:
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
6
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
7 # this is for icons, css, js (and must match url_prefix from wiki config):
3096
8d21b13482e3 updating some version numbers
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3071
diff changeset
8 Alias /moin_static170/ /usr/share/moin/htdocs/
2972
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
9
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
10 # this is the URL http://servername/moin/ you will use later to invoke moin:
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
11 WSGIScriptAlias /moin/ /some/path/moin.wsgi
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
12
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
13 # create some wsgi daemons - use someuser.somegroup same as your data_dir:
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
14 WSGIDaemonProcess daemonname user=someuser group=somegroup processes=5 threads=10 maximum-requests=1000
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
15 # umask=0007 does not work for mod_wsgi 1.0rc1, but will work later
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
16
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
17 # use the daemons we defined above to process requests!
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
18 WSGIProcessGroup daemonname
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
19
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
20 @copyright: 2007 by MoinMoin:ThomasWaldmann
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
21 @license: GNU GPL, see COPYING for details.
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
22 """
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
23
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
24 import sys
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
25
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
26 # Path to MoinMoin package, needed if you installed with --prefix=PREFIX
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
27 # or if you did not use setup.py.
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
28 ## sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
29
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
30 # Path of the directory where farmconfig.py is located (if different).
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
31 ## sys.path.insert(0, '/path/to/farmconfig')
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
32
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
33 # Path of the directory where wikiconfig.py is located.
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
34 # YOU NEED TO CHANGE THIS TO MATCH YOUR SETUP.
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
35 sys.path.insert(0, '/path/to/wikiconfig')
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
36
3015
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
37 import logging
2972
70f2d676920b add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
38
3015
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
39 from MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
40
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
41 class Config(WsgiConfig):
3105
80e1a910a2f1 make logging more configurable and flexible, packages/modules shall call MoinMoin.server.getLogger
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3096
diff changeset
42 pass
3015
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
43
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
44 config = Config() # MUST create an instance to init logging!
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
45
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
46 application = moinmoinApp
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
47