我正在尝试将AWStats添加到我正在工作的Apache网站上。 但是当我去我的Perl脚本失败:
http://localhost/awstats/awstats.pl?config=my.domain.here
我在浏览器中得到这个错误500:
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
我有以下错误日志条目
[Mon Feb 01 19:59:48 2010] [error] [client 127.0.0.1] (OS 2)The system cannot find the file specified. : couldn't create child process: 720002: awstats.pl [Mon Feb 01 19:59:48 2010] [error] [client 127.0.0.1] (OS 2)The system cannot find the file specified. : couldn't spawn child process: C:/Program Files/AWStats/wwwroot/cgi-bin/awstats.pl
我以为这可能是由于cgi没有启用,所以我把这个添加到我的configuration文件中:
ScriptAlias /cgi-bin/ "C:/Program Files/AWStats/wwwroot/cgi-bin/" <Directory "C:/Program Files/AWStats/wwwroot/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory>
但是这似乎没有帮助。 请注意,AWStats在configuration文件的末尾插入了以下内容:
Alias /awstatsclasses "C:/Program Files/AWStats/wwwroot/classes/" Alias /awstatscss "C:/Program Files/AWStats/wwwroot/css/" Alias /awstatsicons "C:/Program Files/AWStats/wwwroot/icon/" ScriptAlias /awstats/ "C:/Program Files/AWStats/wwwroot/cgi-bin/"
请注意,本地主机似乎去我的第一个虚拟条目:
<VirtualHost *:80> DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\myDomain" ServerName my.domain.here Redirect /index.html http://my.domain.here/myDirectory
请提出可能出错的地方。
谢谢。
你有Perl安装? AFAIK ActivePerl是每个人使用的。
我不得不做了以下额外的事情来得到这个工作:
1)通过向我的Apache httpd.conf文件添加以下选项来激活CGI:
Options ExecCGI AddHandler cgi-script .cgi .pl
2)编辑我的Perl脚本,将#!/ usr / bin / perl的默认位置replace为我的windows perl install的位置:#!c:/Perl/bin/perl.exe
然后它的工作!