cfg.history_paging: fix grammar/remove performance warning (we don't do that at other places either)
2 # -*- coding: utf-8 -*-
4 MoinMoin - CGI/FCGI Driver script
6 @copyright: 2000-2005 by Juergen Hermann <jh@web.de>,
10 @license: GNU GPL, see COPYING for details.
15 # a) Configuration of Python's code search path
16 # If you already have set up the PYTHONPATH environment variable for the
17 # stuff you see below, you don't need to do a1) and a2).
19 # a1) Path of the directory where the MoinMoin code package is located.
20 # Needed if you installed with --prefix=PREFIX or you didn't use setup.py.
21 #sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
23 # a2) Path of the directory where wikiconfig.py / farmconfig.py is located.
24 # See wiki/config/... for some sample config files.
25 #sys.path.insert(0, '/path/to/wikiconfigdir')
26 #sys.path.insert(0, '/path/to/farmconfigdir')
28 # b) Configuration of moin's logging
29 # If you have set up MOINLOGGINGCONF environment variable, you don't need this!
30 # You also don't need this if you are happy with the builtin defaults.
31 # See wiki/config/logging/... for some sample config files.
32 from MoinMoin import log
33 #log.load_config('/path/to/logging_configuration_file')
34 logging = log.getLogger(__name__)
36 ## this works around a bug in flup's CGI autodetection (as of flup 1.0.1):
37 #os.environ['FCGI_FORCE_CGI'] = 'Y' # 'Y' for (slow) CGI, 'N' for FCGI
39 # Creating the WSGI application
40 # use shared=True to have moin serve the builtin static docs
41 # use shared=False to not have moin serve static docs
42 # use shared='/my/path/to/htdocs' to serve static docs from that path
43 from MoinMoin.web.serving import make_application
44 app = make_application(shared=True) # <-- adapt here as needed
46 # Is fixing the script name needed?
47 # Use None if your url looks like http://domain/wiki/moin.fcgi
48 # Use '' if you use rewriting to run at http://domain/
49 # Use '/mywiki' if you use rewriting to run at http://domain/mywiki/
50 fix_script_name = None # <-- adapt here as needed
52 if fix_script_name is None:
55 def script_name_fixer(env, start):
56 env['SCRIPT_NAME'] = fix_script_name
57 return app(env, start)
58 application = script_name_fixer
61 # CGI with Apache2 on Windows (maybe other combinations also) has trouble with
62 # URLs of non-ASCII pagenames. Use True to enable middleware that tries to fix.
63 fix_apache_win32 = False # <-- adapt here as needed
66 from werkzeug.contrib.fixers import PathInfoFromRequestUriFix
67 application = PathInfoFromRequestUriFix(application)
70 ## Choose your server mode (threaded, forking or single-thread)
72 # v-- adapt here as needed
73 from flup.server.fcgi import WSGIServer
74 # from flup.server.fcgi_fork import WSGIServer
75 # from flup.server.fcgi_single import WSGIServer
77 logging.warning("No flup-package installed, only basic CGI support is available.")
78 from MoinMoin.web._fallback_cgi import WSGIServer
80 WSGIServer(application).run()