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應該設置處理程序。你確定這是正在下載的腳本,而不是它的輸出? –