[mod_python] Bug with document root.

Jim Gallacher jpg at jgassociates.ca
Sun Mar 12 11:27:32 EST 2006


Aaak! Maybe I should step away from the computer for a day. Sorry for 
the previous, content-free email.

What I wanted to say is you *can* include a domain name in 
<VirtualHost>, but it's something I like to avoid. You might want to try 
using a fully qualified domain name instead of jaimys.

This will be my last message until I smarten up. :)

Jim

Jim Gallacher wrote:
> Wouter van Marle wrote:
> 
>> And then I'm now trying to reproduce the behaviour and I can't get back
>> the error!
>> :-(
>> So strange.
>> Now I really don't understand it anymore...
>> The whole Vhosts thing doesn't work either. It always displays the first
>> host in the definition. Also very irritating as on this box I want to
>> test a few different sites - not nice to every time have to edit the
>> apache config, restart server, etc.
> 
> 
> Your virtual host config is messed up, so apache is using the first one 
> as the default. From your previous email:
> 
>     <VirtualHost jaimys>
>        ServerAdmin wouter at jaimysoutdoorkitchens.com
>        ServerName www.jaimysoutdoorkitchens.com
>        ServerAlias jaimys
> 
> 
> What's up with the <VirtualHost jamimys>? It should contain an ip 
> address or wild card:
> 
> <VirtualHost *>
> or
> <VirtualHost *:80>
> or
> <VirtualHost 192.168.1.1>
> 
> (You'll need to substitute the correct ip address for 192.168.1.1).
> 
> This should get you back to the point where you can deal with the 
> original bug. ;)
> 
> Jim
> 
>> Wouter.
>>
>> On Sun, 2006-03-12 at 10:13 -0500, Jim Gallacher wrote:
>>
>>
>>> Hi Wouter,
>>>
>>> Which version of mod_python are you using?
>>>
>>> Could you also provide the 2 different configurations and a snippet 
>>> of the code that is causing the problem? Maybe it should be obvious 
>>> from the traceback, but after reading the first 3 lines this morning 
>>> my brain seized. ;)
>>>
>>> Jim
>>>
>>>
>>> Wouter van Marle wrote:
>>>
>>>> Hi all,
>>>>
>>>> I think I ran into a bug of mod_python, regarding sessions. If I define
>>>> my site (and document root) in the Vhosts section, I get the below
>>>> error. If it is defined in the main configuration of apache (single
>>>> site) then there is no problem. Very strange, as the Vhosts idea 
>>>> used to
>>>> work (well... that is... Apache recognises and uses only the first
>>>> definition, so not all goes that great). Running Mandrake 10.1.
>>>>
>>>> Wouter.
>>>>
>>>>
>>>> Mod_python error: "PythonHandler mod_python.publisher"
>>>>
>>>> Traceback (most recent call last):
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line
>>>> 299, in HandlerDispatch
>>>>    result = object(req)
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/publisher.py", line
>>>> 136, in handler
>>>>    result = util.apply_fs_data(object, req.form, req=req)
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/util.py", line 361,
>>>> in apply_fs_data
>>>>    return object(**args)
>>>>
>>>>  File "/var/www/html/jaimys/python/main.py", line 38, in home
>>>>    req.session = util.getSession(req)
>>>>
>>>>  File "/var/www/html/jaimys/python/util.py", line 80, in getSession
>>>>    sess = Session.Session(req)
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line
>>>> 389, in Session
>>>>    timeout=timeout, lock=lock)
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line
>>>> 294, in __init__
>>>>    timeout=timeout, lock=lock)
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line
>>>> 132, in __init__
>>>>    Cookie.add_cookie(self._req, self.make_cookie())
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line
>>>> 160, in make_cookie
>>>>    c.path = dirpath[len(docroot):]
>>>>
>>>> TypeError: unsubscriptable objectMod_python error: "PythonHandler
>>>> mod_python.publisher"
>>>>
>>>> Traceback (most recent call last):
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line
>>>> 299, in HandlerDispatch
>>>>    result = object(req)
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/publisher.py", line
>>>> 136, in handler
>>>>    result = util.apply_fs_data(object, req.form, req=req)
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/util.py", line 361,
>>>> in apply_fs_data
>>>>    return object(**args)
>>>>
>>>>  File "/var/www/html/jaimys/python/main.py", line 38, in home
>>>>    req.session = util.getSession(req)
>>>>
>>>>  File "/var/www/html/jaimys/python/util.py", line 80, in getSession
>>>>    sess = Session.Session(req)
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line
>>>> 389, in Session
>>>>    timeout=timeout, lock=lock)
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line
>>>> 294, in __init__
>>>>    timeout=timeout, lock=lock)
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line
>>>> 132, in __init__
>>>>    Cookie.add_cookie(self._req, self.make_cookie())
>>>>
>>>>  File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line
>>>> 160, in make_cookie
>>>>    c.path = dirpath[len(docroot):]
>>>>
>>>> TypeError: unsubscriptable object
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>> _______________________________________________
>>>> Mod_python mailing list
>>>> Mod_python at modpython.org
>>>> http://mailman.modpython.org/mailman/listinfo/mod_python
>>>
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Mod_python mailing list
>> Mod_python at modpython.org
>> http://mailman.modpython.org/mailman/listinfo/mod_python
> 
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
> 



More information about the Mod_python mailing list