问题原文
原帖链接 · Joshi · CC BY-SA 3.0
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.
已采纳解答
原帖链接 · Joshi · CC BY-SA 3.0
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>
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
