2011/5/3 boscop <[email protected]>:
> Hi,
> I'm on a free shared hosting account where I have no access to
> httpd.conf, but .htaccess. I have no shell access, but FTP and cPanel.
> Python is available via mod_python and mod_wsgi. I want to use one of
> the WSGI frameworks for my site. They all require that there is
> exactly one WSGI application (usually specified with
> 'WSGIScriptAlias / /path/to/app.wsgi' but this would only work in
> httpd.conf) which gets the requested path passed in
> environ['PATH_INFO']. Currently I have 'AddHandler wsgi-script .py'
> set in .htaccess, but this would cause apache to resolve the path and
> look for a wsgi script at that location, instead of passing the path
> to the main application. All frameworks that I checked out are based
> on there being only one application though (!). So I tried to use
> mod_rewrite to achieve the passing of the path to the main application
> like this:
>
> RewriteEngine On
> RewriteRule ^(.*)$ /absolute/path/to/index.py$1 [QSA,L,PT]
>
> However, this causes an internal server error (500) on any request,
> and it says "More information about this error may be available in the
> server error log. Additionally, a 500 Internal Server Error error was
> encountered while trying to use an ErrorDocument to handle the
> request.". But no error was logged! (I confirmed that error logging
> usually works by removing that line and introducing other bugs. Also,
> having multiple wsgi apps and requesting them individually works,
> too).
> This leads me to my question: What would I have to write in .htaccess
> to cause apache to pass the requested path to the one WSGI application
> so that it correctly appears in environ['PATH_INFO'] and so that it
> also handles GET parameters correctly,

This works with Apache 2.2:

SetEnvIfNoCase Request_URI ^\index\.py(.*) PATH_INFO=$1

Regards, Clodoaldo


(and why does the above line
> prevent error logging)?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/modwsgi?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to