[mod_python] Multiple calls to authenhandler()

Rune Hansen rune.hansen at scanmine.com
Wed Nov 3 11:50:32 EST 2004


On 3. nov 2004, at 16.40, Jorey Bump wrote:

> Rune Hansen wrote:
>> Hi,
>> I get one call to authenthandler() when I access 
>> http://www.mysite.com/
>> I get two calls to authenthandler() when I access 
>> http://www.mysite.com/myHandler.py/search
>> and..
>> I get three(!) calls to authenthandler() when I access 
>> http://www.mysite.com/search.html, where search.html is an Apache 
>> Rewrite of myHandler.py/search.
>> Does anyone know how to avoid this?
>> My Apache directory directive is:
>> <VirtualHost *:80>
>>     ServerName www.myhost.com
>>     ServerAdmin root at host
>>     DocumentRoot /var/www/html/search
>>     .
>> </VirtualHost>
>> <Directory "/var/www/html/search">
>>     .
>>     RewriteEngine On
>>     RewriteBase /
>>     RewriteRule search.html "myHandler.py/search"
>>     DirectoryIndex myHandler.py
>>     AddHandler mod_python .py
>>     PythonHandler mod_python.publisher
>>     PythonAuthenHandler AuthentHandler
>>     AuthType Basic
>>     AuthName "Restricted Area"
>>     require valid-user
>>     PythonPath "sys.path+['...']"
>>     PythonDebug On
>> </Directory>
>> It will kill performance if I have to re-verify the user three times 
>> for each request. Sessions are, unfortunately, not an option.
>> Any suggestions will be most welcome :)
>
> Are the results any different if you use this instead of a rewrite?
>
>  Redirect /search.html http:/www.mysite.com/myHandler.py/search
>
Hi Jorey,
It seems to work and although it "solves" the problem, it's not at all 
what I want(the client(s) accessing the service might not be able to 
respond to a 303).

There has to be a way to control how and when the authenthandler() is 
invoked...?

regards

/rune


"So as far as I'm concerned, SOAP is not XML, nor is it useful to even a
fraction of the degree to which it is destructive."
- Uche Ogbuji



More information about the Mod_python mailing list