Description
Currently it is not possible to modify the script_name easily though it is an option which value differs in many cases. Without internal hacking, the following scenarios are broken currently:
- CGI, FastCGI using a rewrite/alias system in the httpd
- CGI, FastCGI using a webserver which does not send a sensible script_name at all (e.g. LightHTTPD)
mod_python for wikis that do not run in the root directory /
This is a mod python specific problem, when there is no real script, when using Location directive and that funny PythonHandler MoinMoin.request::RequestModPy.run syntax. Its an undefined situation. See MoinMoinBugs/ModPyWikiOnlyOneDirDeep.
The problem is that the webserver does not know where to trim the script_path as the script name vanished from the request URL at all. Example:
- Script is /cgi-bin/moin.cgi
- Something in the webserver allows requests to /mywiki to go to that script
- The httpd cannot find out where the script_name in /mywiki/FrontPage is (in fact, there is not any, just a kind of mount point)
So we need a possibility to set the script_name in MoinMoin manually as well (not for all installations, but many will need it).
Details
See above.
Workaround
Modify the request.py code to rewrite SCRIPT_NAME accordingly.
Lighttpd fix: self.script_name = env.get('DOCUMENT_ROOT', '') into request.py
Discussion
I could easily use rewrite rules and cgi with Apache 1 and 2 on Mac OS X, using this setup:
<Directory "/path/to"> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> RewriteEngine On RewriteLogLevel 0 RewriteRule ^/fix-wiki(.*)$ /path/to/htdocs/$1 [last] RewriteRule ^/fix(/)?(.*)$ /path/to/moin.cgi/$2 [type=application/x-httpd-cgi]
- Note that this setup uses options in httpd.conf which is not possible for most installs. Please try to get it working without editing httpd.conf.
This bug will be fixed by propagating the use of the properties parameter of the request constructor (done by AlexanderSchremmer) and applying a patch written by Nir for mod_py.
Plan
- Priority:
Assigned to: AlexanderSchremmer/NirSoffer
Status: This is related to MoinMoinBugs/ExtraSlashInLinksUsingModPy, MoinMoinBugs/ModPyWikiOnlyOneDirDeep and MoinMoinBugs/modPyGetsUnquotedScriptName. Fixing this bug fixed those.