大网数据广告活动
服务器运维问答

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

· 52CE 我爱测

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 +Exec…

问题原文

原帖链接 · 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>

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-07-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。