[mod_python] DirectoryIndex and mod_python problem?

Marc Poulhiès marc.poulhies at epfl.ch
Sat Nov 27 09:21:56 EST 2004


Hi,

I'm using apache 1.3.31 and mod_python :2.7.10 (from debian testing) and
have a strange problem. After trying to update my apache to apache2, I
removed apache2 and tried to keep running my old installation.

I'm using a simple configuration for the website using python:

<VirtualHost 81.56.230.184>
  ServerName www.kataplop.net
  DocumentRoot /var/www/devsite/
  CustomLog /var/log/apache/www/access.log combined
    
  <Directory /var/www/devsite/>
    AddHandler python-program .py
    PythonHandler index
    PythonDebug on
##        PythonPath "sys.path+['/var/www/devsite/']"
    Options FollowSymLinks
    AllowOverride All
    DirectoryIndex index.py
  </Directory>
</VirtualHost>

If I point my browser to http://www.kataplop.net/foo.py, I get the
expected result (the python script index.py prints text...). If I simply
point the browser to http://www.kataplop.net/, I can download the
index.py file (I got the script, not the text the script should print).
I really don't understand what's wrong.
Second point is that if I don't use VirtualHost, I can make it work a
bit more:

ServerName www.kataplop.net
DocumentRoot /var/www/devsite/
CustomLog /var/log/apache/www/access.log combined

<Directory /var/www/devsite/>
  AddHandler python-program .py
  PythonHandler index
  PythonDebug on
  PythonPath "sys.path+['/var/www/devsite/']"
  Options FollowSymLinks
  AllowOverride All
  DirectoryIndex index.py
</Directory>

Pointing browser to http://stju.kataplop.net/index.py works, but still,
http://stju.kataplop.net does not work (even with the DirectoryIndex
directive).

Is this an apache config issue or is this a mod_python problem?

Thanks,

-- 
Marc Poulhiès
http://www.kataplop.net


More information about the Mod_python mailing list