3

我正在尝试加载 cgi-bin,但我不断收到 403 权限错误。当我尝试加载 cgi-bin/index.pl 时,找不到 404 页面。项目权限使用 chmod -R 755 设置。

服务器正在使用 php5-cgi 运行 debian squeeze、apache2。

这是 /etc/apache2/sites-enabled/000-default:

DocumentRoot /var/www/
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/>
            Options +Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    Alias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

错误日志:

[Mon Jul 30 09:39:30 2012] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze13 with Suhosin-Patch configured -- resuming normal operations
[Mon Jul 30 09:50:44 2012] [error] Directory index forbidden by Options directive: /usr/lib/cgi-bin/
4

1 回答 1

2

(在评论或编辑中回答了问题。请参阅没有答案的问题,但在评论中解决了问题(或在聊天中扩展)

OP写道:

已解决:将 000-default 的底部更改为:

ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
</Directory>

然后安装了一些缺少的 perl 模块并且它工作了。能够打开浏览器到/localhost/cgi-bin/index.pl.

于 2015-01-26T14:24:09.197 回答