我在Ubuntu 14.04.1上安装了LAMP。
我希望能够从我网站内的所有目录运行cgi脚本。所以我将其添加到/etc/apache2/apache.conf
<Directory /var/www/>
AddHandler cgi-script .cgi .pl
Options FollowSymLinks +ExecCGI
</Directory>
我也在/etc/apache2/mods-enabled/mime.conf
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler cgi-script .cgi .py .pl
但现在当我访问我的剧本时,它说
您无权访问此服务器上的/hello.pl.
但是我已经对剧本进行了chmodded和chouse ..其实看起来......
ls -la hello.cgi
-rwxrwxrwx 1 www-data www-data 84 Jan 26 03:19 hello.pl
答案 0 :(得分:0)
(Banned_User的自我回答从问题正文移出)
我所做的是修改/etc/apache2/sites-enabled/www.example.com/
并添加:
<Directory /var/www/www.example.com>
Options +ExecCGI
</Directory>