[mod_python] Getting mptest.py to work

Johann Spies jspies at sun.ac.za
Wed Jan 19 07:21:55 EST 2005


Dear Graham,

Thanks for your patience and help.  As you can see I have a lot to
learn about apache and related products.

On Wed, Jan 19, 2005 at 10:03:44PM +1100, Graham Dumpleton wrote:
> 
> Do a sanity check to see if the .htaccess file is actually being read.
> One can use another feature of mod_python to check this. Add:
> 
>   PythonOption Name
> 
> If mod_python is working okay and the .htaccess file is being read,
> this should cause a 500 server error to be returned as a value for
> option hasn't been supplied.

This did not produce any error or success.

> 
> If you don't see this, then might be that main httpd.conf file not
> configured to allow .htaccess in that part of directory hierarchy,
> although, not sure if that is possible.
> 
> Next step might be to use the original <Directory> directive block
> you had and put it in the main httpd.conf in an appropriate spot
> to see if that makes a difference.

So I  created a file in /etc/apache2/sites-enabled with the following
content:

<Directory /var/www/test/>
   AddHandler mod_python .py
   PythonHandler mptest
   PythonDebug On
</Directory>
 
And now I get the 500 server error when I click on mptest.py (just in
the browser - nothing in /var/log/apache2/error.log) after a
considerable period of time. Going just to http://localhost/test/
results in a directory being displayed with no error message.

Regards
Johann

-- 
Johann Spies          Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch

     "The LORD is my strength and song, and he is become my 
      salvation; he is my God, and I will prepare him an 
      habitation; my father's God, and I will exalt him."   
                       Exodus 15:2 


More information about the Mod_python mailing list