Здравствуйте. Установил awstats из портов, все настроил как написано в инструкции, из командной строки команда ./awstats.pl -config="mysite.net" выполняется без ошибок, создается лог файл по сайту, все ок вобщем. Но пробую через браузер запустить, появляется ошибка 500 Internal Server Error, в логах
[Mon Sep 07 13:21:05 2009] [error] [client x.x.x.x] Premature end of script headers: awstats.plВот что на сайте австатса по этому поводу написано
FAQ-SET150 : INTERNAL ERROR 500 IN MY BROWSER
FAQ-SET200 : ERROR "... COULDN'T CREATE/SPAWN CHILD PROCESS..."
PROBLEM:
AWStats seems to run fine at the command prompt but when ran as a CGI from a browser, I get an "Internal Error 500".
I also also might have the following message in my Apache error log file (or in browser with Apache 2.0+):
...couldn't create/spawn child process: c:/mywebroot/cgi-bin/awstats.pl
SOLUTION:
First, try to run awstats.pl from command line to see if file is correct. If you get some syntax errors and use a Unix like OS, check if your file is a Unix like text file (This means each line end with a LF char and not a CR+LF char).
If awstats.pl file runs correctly from command line, this is probably because your web server is not able to known how to run perl scripts. This problem can occur with Apache web servers with no internal Perl interpreter (mod_perl not active). To solve this, you must tell Apache where is your external Perl interpreter.
For this, you have 2 solutions:
1) Add the following directive in your Apache httpd.conf config (or remove the # to uncomment it if line is already available)
ScriptInterpreterSource registry
Then restart Apache. This will tell Apache to look into the registry to find the program associated to .pl extension.
2) Other solution (not necessary if first solution works): Change the first line of awstats.pl file with the full path of your Perl interpreter.
Example with Windows OS and ActivePerl Perl interpreter (installed in C:\Program Files\ActiveState\ActivePerl), you must change the first line of awstats.pl file with:
#!c:/program files/activestate/activeperl/bin/perl
я изменил в скрипте #!/usr/bin/perl на #!/usr/local/bin/perl, но не помогло, незнаю что еще можно придумать, подскажите плз
вот настройки апача
LoadModule authz_host_module libexec/apache22/mod_authz_host.so
LoadModule authz_groupfile_module libexec/apache22/mod_authz_groupfile.so
LoadModule authz_user_module libexec/apache22/mod_authz_user.so
LoadModule auth_basic_module libexec/apache22/mod_auth_basic.so
LoadModule auth_digest_module libexec/apache22/mod_auth_digest.so
LoadModule include_module libexec/apache22/mod_include.so
LoadModule filter_module libexec/apache22/mod_filter.so
LoadModule log_config_module libexec/apache22/mod_log_config.so
LoadModule mime_module libexec/apache22/mod_mime.so
LoadModule status_module libexec/apache22/mod_status.so
LoadModule info_module libexec/apache22/mod_info.so
LoadModule suexec_module libexec/apache22/mod_suexec.so
LoadModule cgid_module libexec/apache22/mod_cgid.so
LoadModule vhost_alias_module libexec/apache22/mod_vhost_alias.so
LoadModule dir_module libexec/apache22/mod_dir.so
LoadModule alias_module libexec/apache22/mod_alias.so
LoadModule rewrite_module libexec/apache22/mod_rewrite.so
#LoadModule php5_module libexec/apache22/libphp5.so
LoadModule geoip_module libexec/apache22/mod_geoip.so
GeoIPEnable on
LoadModule fcgid_module libexec/apache22/mod_fcgid.so
<IfModule mod_fcgid.c>
AddHandler fcgid-script .php
</IfModule>
User www
Group www
Listen 80
<Directory />
AllowOverride All
</Directory>
#Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
#Alias /postfixadmin/ "/usr/local/www/postfixadmin/"
Alias /awstatsclasses "/home/user/www/mysite.net/awstats/classes/"
Alias /awstatscss "/home/user/www/mysite.net/awstats/css/"
Alias /awstatsicons "/home/user/www/mysite.net/awstats/icons/"
ScriptAlias /awstats/ "/home/user/www/mysite.net/awstats/"
<Directory "/home/user/www/mysite.net/awstats/">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.htm index.html index.shtml index.php
</IfModule>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
ErrorLog "/var/log/httpd-error.log"
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%V %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" Vcombined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "/var/log/httpd-access.log" combined
#CustomLog "/var/log/httpd-access.log" Vcombined
</IfModule>
<IfModule cgid_module>
#Scriptsock /var/run/cgisock
</IfModule>
DefaultType text/plain
<IfModule mime_module>
TypesConfig etc/apache22/mime.types
#AddType application/x-gzip .tgz
AddType application/x-httpd-php .php
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddHandler cgi-script .pl .cgi
#AddHandler type-map var
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>
#ScriptInterpreterSource registry
#MIMEMagicFile etc/apache22/magic
EnableMMAP on
EnableSendfile on
Include etc/apache22/extra/httpd-mpm.conf
#Include etc/apache22/extra/httpd-multilang-errordoc.conf
#Include etc/apache22/extra/httpd-autoindex.conf
#Include etc/apache22/extra/httpd-languages.conf
#Include etc/apache22/extra/httpd-userdir.conf
Include etc/apache22/extra/httpd-info.conf
Include etc/apache22/extra/httpd-vhosts.conf
#Include etc/apache22/extra/httpd-manual.conf
#Include etc/apache22/extra/httpd-dav.conf
Include etc/apache22/extra/httpd-default.conf
#Include etc/apache22/extra/httpd-ssl.conf
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include etc/apache22/Includes/*.conf