1
我想通过本地主机测试perl脚本。我配置了Apache以允许Perl脚本从/ usr/lib/cgi-bin运行(或者我认为)。每当我去localhost/cgi-bin/script.pl,我得到一个403 Forbidden错误。这是我的apache conf文件。403在Apache中运行perl脚本时出错
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /home/cgtopher/public_html/
<Directory /home/cgtopher/public_html/>
Options FollowSymLinks Indexes
AllowOverride None
Order allow,deny
allow from all
</Directory>
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
#cgi-bin
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI FollowSymLinks
Order allow,deny
Require all granted
</Directory>
ErrorLog /home/cgtopher/.apache/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
在我的错误日志中我不断收到这样的:
[Sat Sep 05 10:30:12.565510 2015] [access_compat:error] [pid 10918] [client 127.0.0.1:60699] AH01797: client denied by server configuration: /usr/lib/cgi-bin/hello.pl
感谢您的支持!看起来它的工作,只有一个警告。而不是脚本运行(只是一个测试你好世界),我得到提示下载它。所以我们到了一半! – cgtopher
这很奇怪。 ScriptAlias应该设置处理程序。你确定这是正在下载的脚本,而不是它的输出? –