Russell Lear
RussLear314 at yahoo.com
Sat Dec 27 19:44:55 EST 2003
Hi, I'm a newbie to mod_python so forgive me if this is a terribly obvious question (I've looked through the archives without much success). I'm trying to use sessions. Right now I have a slightly modified version of mptest.py as follows (it doesn't make sense, but it does show my problem): from mod_python import apache, Session import sys def handler(req): req.content_type = 'text/plain' req.write("Creating...\n") sess = Session.Session(req) req.write("Hello World!") return apache.OK When I run it, I see: Mod_python error: "PythonHandler mptest" Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 338, in HandlerDispatch result = object(req) File "/srv/www/htdocs/test/mptest.py", line 7, in handler sess = Session.Session(req) File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line 411, in Session timeout=timeout) File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line 316, in __init__ secret=secret, timeout=timeout) File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line 170, in __init__ self.lock() # lock new sid File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line 241, in lock _apache._global_lock(self._req.server, self._sid) ValueError: Failed to acquire global mutex lock What am I doing wrong here?! Thanks for any suggestions, Russell. PS: I'm running on SuSE 9.0 Linux. Python reports version "Python 2.3+ (#1, Sep 23 2003, 23:07:16)". >From the Apache error page: Apache/2.0.48 (Linux/SuSE), mod_python/3.1.2b Python/2.3+. The only glitch I had in building mod_python was that I needed to specify ./configure --with-apxs=/usr/sbin/apxs2 rather than just refering to apxs. My apache configuration is (from the tutorial): <Directory /srv/www/htdocs/test> AddHandler python-program .py PythonHandler mptest PythonDebug On </Directory>
|