[mod_python] handler and index.html problem

Sells, Fred fred at adventistcare.org
Thu Oct 19 15:50:55 EDT 2006


I'm a mod_python newbie using python 2.3 and mod_python 3.1.3-5.1 on Red Hat
Enterprise Linux

I have my own "security.py" module that I want to intercept all requests
into the html root (/var/www/html) and force the user to login if they have
not already.  I must use a legacy login, so using the apache authentication
is not an option.  The intercept and login work fine, but once they are
logged in,  any reference to the directory, hence an implied index.html page
fails.  my .conf setup is

 
   <Directory "/var/www/html">
     SetHandler python-program
     PythonHandler  security default
     PythonDebug On
   </Directory>
 
 http://fredqa.xxx.org/rds/unittest.html  this works, is simple html no js
or css includes
 http://fredqa.xxx.org/rds/index.html     this works, has links to js and
css embedded
 http://fredqa.xxx.org/rds/               this FAILS, see error message
below
 
 Mod_python error: "PythonHandler default"
 Traceback (most recent call last):
   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 287,
in
 HandlerDispatch log=debug)
   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 454,
in
 import_module
     f, p, d = imp.find_module(parts[i], path)
 ImportError: No module named default
 
 I've tried "default-handler" with same results.  I would like to have
Apache just render the page, once I've verified that the user has access.

---------------------------------------------------------------------------
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---------------------------------------------------------------------------



More information about the Mod_python mailing list