[mod_python] Multiple calls to authenhandler()

Jorey Bump list at joreybump.com
Wed Nov 3 10:40:45 EST 2004


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



More information about the Mod_python mailing list