beta testing for mod_wsgi

Manlio Perillo manlio_perillo at libero.it
Mon Jan 28 13:47:29 MSK 2008


Adrian Perez ha scritto:
> El Mon, 14 Jan 2008 11:34:44 +0100
> Manlio Perillo <manlio_perillo at libero.it> escribió:
> 
>> Adrian Perez ha scritto:
>>
>> Note that here you do not need an extra script: you can just do in
>> nginx configuration:
>>
>> env  PYTHON_EGG_CACHE /tmp/test/eggs
>>
>> location / {
>>     wsgi_param  trac.env_path /tmp/test
>>     wsgi_pass /path/to/trac.web.main dispatch_request;
>> }
> 
> Confirmed, this is working in my home server now, but with a glich:
> when /login is accessed, status 404 is returned to the client and the
> returned HTML says "Environment not found". The user will be
> authenticated anyway, because the header with the session cookie is
> sent in the response. You can remove the "/login" from the URL
> afterwards and Trac will see you as authenticated. 
> 
> You may see this behaviour at http://foobar.homeunix.org/trac/overlay
> (try to login as guest).
> 

What is the password?
I'm unable to login.


> The traceback looks like the following:
> 
> 
> Traceback (most recent call last):
>    File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 19,in
> <module>
>      import cgi
>    SystemError: Parent module '_wsgi__trac_?' not loaded ,
> 
> 

Ok, this is a bug of mod_wsgi.
The module name is built from the name of the location used, replacing 
'/' with '_'.

In you configuration, the location name is:
/trac/[^/]+/login

and this result in a invalid name for a Python module.


I have to admit that I have never thought about this possibility ;-).


It seems that I have to change the algorithm used for built the module name.

Maybe I should add the possibility to specify the module name in the 
wsgi_pass directive, or I should use an hash of the module name.



 > [...]



Manlio Perillo





More information about the nginx mailing list