Options ExecCGI is off in this directory: /var/www/index.py

apache-2.2cgi

I have looked at alot of posts with a similar question but none seem to work for me

i have the following /etc/apache2/httpd.conf file:

<Directory /var/www/index.py>
Options +ExecCGI
</Directory>

<Directory /var/www>
Options +ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AddHandler cgi-script .py
DirectoryIndex index.py         

</Directory>

<Directory /var/www/tiles>
  AddHandler mod_python .py
  PythonHandler TileStache::modpythonHandler
  PythonOption config /home/TileStache/tilestache.cfg
</Directory>

When i try to access the homepage as : just the host name: http://exampleHost.com
i get the following error on the error log:

Options ExecCGI is off in this directory: /var/www/index.py

but when i go to http://exampleHost.com/index.py it works fine.

So Im guessing something is overriding the /var/www directory? I dont have a .htaccess file in the /var/www directory.

Best Answer

I had to modify the follwing file:

/etc/apache2/sites-enabled/000-default

Changed the /var/www directory to inlcude the +ExecCGI and AddHandler like so:

    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews +ExecCGI
            AllowOverride None
            Order allow,deny
            allow from all
            AddHandler cgi-script .py
    </Directory>