changeset 5492:e900c097a46b

moin.fcgi: fix recursion error, try 2
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 04 Feb 2010 10:44:39 +0100
parents 65bf6cb180b7
children 07833d54f43d
files wiki/server/moin.fcgi
diffstat 1 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/wiki/server/moin.fcgi	Thu Feb 04 10:01:53 2010 +0100
+++ b/wiki/server/moin.fcgi	Thu Feb 04 10:44:39 2010 +0100
@@ -41,16 +41,25 @@
 # use shared=False to not have moin serve static docs
 # use shared='/my/path/to/htdocs' to serve static docs from that path
 from MoinMoin.web.serving import make_application
-application = make_application(shared=True)
+app = make_application(shared=True)  # <-- adapt here as needed
 
-## Uncomment this if you need to set the SCRIPT_NAME:
-#def script_fixer(env, start):
-#    env['SCRIPT_NAME'] = ''  # use '' for running at /, '/wiki' for running at /wiki/
-#    return application(env, start)
-#application = script_fixer
+# Is fixing the script name needed?
+# Use None if your url looks like http://domain/wiki/moin.fcgi
+# Use '' if you use rewriting to run at http://domain/
+# Use '/mywiki' if you use rewriting to run at http://domain/mywiki/
+fix_script_name = None  # <-- adapt here as needed
+
+if fix_script_name is None:
+    application = app
+else:
+    def script_name_fixer(env, start):
+        env['SCRIPT_NAME'] = fix_script_name
+        return app(env, start)
+    application = script_name_fixer
 
 ## Choose your server mode (threaded, forking or single-thread)
 try:
+    # v-- adapt here as needed
     from flup.server.fcgi import WSGIServer
 #    from flup.server.fcgi_fork import WSGIServer
 #    from flup.server.fcgi_single import WSGIServer