annotate wiki/server/moin.wsgi @ 4457:415cbfc3817b

merged moin/1.7
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 13 Dec 2008 19:27:41 +0100
parents afd75bb5f345 ce8e78757a75
children fad2936d33a7
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):
3904
a452a1dab1f7 use /moin_static180
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3903
diff changeset
8 Alias /moin_static180/ /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
3505
cd43bbf56c33 logging: removed logging to ./moin.log from fallback config, better docs
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3111
diff changeset
20 @copyright: 2008 by MoinMoin:ThomasWaldmann
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
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
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
24 import sys, os
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
25
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
26 # a) Configuration of Python's code search path
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
27 # If you already have set up the PYTHONPATH environment variable for the
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
28 # stuff you see below, you don't need to do a1) and a2).
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
29
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
30 # a1) Path of the directory where the MoinMoin code package is located.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
31 # Needed if you installed with --prefix=PREFIX or you didn't use setup.py.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
32 #sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
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
33
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
34 # a2) Path of the directory where wikiconfig.py / farmconfig.py is located.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
35 # See wiki/config/... for some sample config files.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
36 #sys.path.insert(0, '/path/to/wikiconfigdir')
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
37 #sys.path.insert(0, '/path/to/farmconfigdir')
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
38
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
39 # b) Configuration of moin's logging
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
40 # If you have set up MOINLOGGINGCONF environment variable, you don't need this!
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
41 # You also don't need this if you are happy with the builtin defaults.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
42 # See wiki/config/logging/... for some sample config files.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
43 #from MoinMoin import log
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
44 #log.load_config('/path/to/logging_configuration_file')
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
45
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
46 # Debug mode - show detailed error reports
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
47 #os.environ['MOIN_DEBUG'] = '1'
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
48
3111
79f850129782 logging: fix server scripts to load logging config, fix logging configs
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3107
diff changeset
49
3015
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
50 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
51
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
52 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
53 pass
3015
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
54
3505
cd43bbf56c33 logging: removed logging to ./moin.log from fallback config, better docs
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3111
diff changeset
55 config = Config()
3015
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
56
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
57 application = moinmoinApp
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
58