cant get awstats run public

infiltrator

Verified User
Joined
Jun 8, 2006
Messages
41
Hi,
I'm pulling my hair out...

i'm looking for more then 3 weeks for a solution to my problem.

We changed from a dedicated server provider to another, and moved al accounts from a fedora 5 server with directadmin/custombuild/webalizer
to a centos directadmin/custombuild/awstats server.

After rebuilding al the domains and creating new ones, fixing erors.
Setting up webmail etc.
I got to test awstats ( already created with every new account )
awstats runs perfectly from the cp, but when a create a public link ( domain/awstats ) my output is only the source of the perl script.

After looking for a solution, trying thing out, everythings stays the same.

I installed custombuild, to try the fix the problem that way, but everything stays the same.

I tryd to change the apache conf / the .htaccess file, changing the file rigths and the owner of the file, but nothing seems to help...

I tryd on a domain that is restored from the old server but put into a new account, and also on a clean new account with new domain.

On both i get everything ok in the control panel ( the html output as also the awstats.pl output )
but on the domain/awstats i get for the awstats.pl output only the source of the perl script, for the index.html output i get the good results.

The .htacces contains
Code:
Options -Indexes +ExecCGI
AddHandler cgi-script .pl
DirectoryIndex awstats.pl

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.liveweb.be$ [NC]
RewriteRule ^(.*)$ http://liveweb.be/awstats/$1 [R=301,L]

I even tried to put in the directory except of the rewrite rules into the apache.conf file, without any succes.

The awstat.pl file was owned by the user of that account, changing it to root, did not fix it.

It was chmod from 755 to 777 without any succes

Can anyone help, i'm out of webpage sources and solutions...

Its a serverwide problem
 
Is any other Perl scipt running ok? In cgi-bin? Or elsewhere in document root? What is in apache error logs?
 
Is any other Perl scipt running ok? In cgi-bin? Or elsewhere in document root? What is in apache error logs?

The script runs fine when logged in as the user in the directadmin panel.
Like mentioned in my post, so perl must be running fine...
 
is perl installed? Have the correct permission (755)?

Perl is installed - using it also for other things, and like mentioned script runs when logged in the directadmin panel.

It runs not when accessing it outside the panel.

scipt has 755 permission, chnging it to 777 does nothing and changing owner from user to root , doe nothing at al...

The link to the directory has 777 permision.

The directory has 755 permision...
 
The script runs fine when logged in as the user in the directadmin panel.

They are still running in directadmin. I want to know, if other PERL/CGI scripts are running OK in Apache. That will help to understand, is it a AwStats/DA issue or your apache is misconfigured.
 
I have on a other account, eggdrop running that is also using perl / tcl scripting

Other cgi / perl scripts i dont know if they are running on the server.
 
Create public_html/cgi-bin/hello.pl

Code:
$ cd public_html/cgi-bin/ 
$ touch hello.pl
$ chmod +x hello.pl

with content

Code:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<H1>Hello World</H1>\n";

and trigger it in browser.

If it's running OK, put it near to awstats.pl in public_html/awstats. And try trigger it from new location.

What are the results?
 
this is my httpd.conf
Code:
#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see 
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  

ServerRoot "/etc/httpd"
Listen 80

#LoadModule dummy_module /usr/lib/apache/mod_dummy.so
#LoadModule php5_module        /usr/lib/apache/libphp5.so
Include	/etc/httpd/conf/extra/httpd-phpmodules.conf

User apache
Group apache

ServerAdmin admin@localhost
DocumentRoot "/var/www/html"

<Directory /home/*>
    AllowOverride All
    Options -MultiViews -Indexes FollowSymlinks IncludesNoExec +Includes
<Limit GET POST OPTIONS PROPFIND>
    Order allow,deny
    Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
    Order deny,allow
    Deny from all
</LimitExcept>
</Directory>

<Directory />
    Options All
    AllowOverride All
</Directory>

<Directory "/var/www/html">
    Options -Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
   <IfModule mod_suphp.c>
        suPHP_Engine On
        suPHP_UserGroup webapps webapps
	SetEnv PHP_INI_SCAN_DIR
   </IfModule>
</Directory>

<IfModule dir_module>
    DirectoryIndex awstats.pl index.html index.htm index.shtml index.php index.php5 index.php4 index.php3 index.phtml index.cgi
</IfModule>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

ErrorLog /var/log/httpd/error_log
LogLevel warn

<IfModule log_config_module>
    #replace %b with %O for more accurate logging
    <IfModule mod_logio.c>
      LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
      LogFormat "%h %l %u %t \"%r\" %>s %O" common
      LogFormat "%O %I" bytes

      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    CustomLog /var/log/httpd/access_log common
</IfModule>

<IfModule alias_module>
    # Include some DirectAdmin alias
    Include conf/extra/httpd-alias.conf
</IfModule>

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

DefaultType text/plain

<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-gzip .tgz
    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    AddHandler type-map var
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
	AddType video/x-ms-asf .avi
	AddType video/mpeg .mpg
	AddType video/mpeg .mpeg
	AddType video/quicktime .mov
	AddType video/x-ms-wmv .wmv
</IfModule>

#EnableMMAP off
#EnableSendfile off

#######################################################################################
# Do not change anything in included files, because they are rewritten by DirectAdmin #
#######################################################################################

# This is needed for PHP
Include conf/extra/httpd-php-handlers.conf

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

# Multi-language error messages
Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
Include conf/extra/httpd-autoindex.conf

# Language settings
Include conf/extra/httpd-languages.conf

# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf

# Various default settings
Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf

# Deflate module settings
Include conf/extra/httpd-deflate.conf

# All the DirectAdmin vhosts
Include conf/extra/directadmin-vhosts.conf

# All suPHP directives
Include conf/extra/httpd-suphp.conf

# For user configurations not maintained by DirectAdmin. Empty by default.
Include conf/extra/httpd-includes.conf

#######################################################################################
# End of included files that are rewritten by DirectAdmin                             #
#######################################################################################

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
 
and this i have for my httpd-includes.conf

Code:
# error documents liveweb #

Alias /errordocs /etc/httpd/errordocs
<Directory /etc/httpd/errordocs>
AllowOverride none
Options MultiViews IncludesNoExec FollowSymLinks
AddType text/html .shtml
AddHandler server-parsed .shtml
</Directory>
# "400 Bad Request",
ErrorDocument 400 /errordocs/400
# "401 Authorization Required",
ErrorDocument 401 /errordocs/401
# "403 Forbidden",
ErrorDocument 403 /errordocs/403
# "404 Not Found",
ErrorDocument 404 /errordocs/404
# "500 Internal Server Error",
ErrorDocument 500 /errordocs/500

# error documents liveweb #

# Aanpassing voor awstats directory #

<Directory "/home/*/domains/*/awstats">
		Options +ExecCGI -Indexes
</Directory>

# Aanpassing voor awstats directory #
 
general error logs : no errors

vhost error log :

when trying to run domain/cgi-bin/hello.pl
Code:
[Wed May 04 20:57:35 2011] [error] [client 66.249.72.90] File does not exist: /usr/local/awstats-6.95/wwwroot/cgi-bin/hello.pl
and

when trying to run domain/awstats/hello.pl
Code:
[Wed May 04 20:59:24 2011] [error] [client 78.22.176.26] File does not exist: /home/activew72/domains/liveweb.be/public_html/awstats
 
OK, try to disable mod_rewrite

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.liveweb.be$ [NC]
RewriteRule ^(.*)$ http://liveweb.be/awstats/$1 [R=301,L]

and do all again with awstats and hello.pl script.

p.s. Are you sure you put in right order output of vhost error log?

File does not exist: /usr/local/awstats-6.95/wwwroot/cgi-bin/hello.pl

this line worries me. Any way let's try with disabled mod_rewrite.
 
Last edited:
.htaccess in awstats dir
Code:
Options -Indexes +ExecCGI
AddHandler cgi-script .pl
DirectoryIndex awstats.pl

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.liveweb.be$ [NC]
RewriteRule ^(.*)$ http://liveweb.be/awstats/$1 [R=301,L]

browser : http://www.liveweb.be/cgi-bin/hello.pl
returns : The page you searched couldn't be displayed

error log apache.log
[Thu May 05 14:05:51 2011] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?

But is only when restarting httpd service, not browsing.
domainlog :
[Thu May 05 14:15:01 2011] [error] [client 78.22.181.223] File does not exist: /usr/local/awstats-6.95/wwwroot/cgi-bin/hello.pl

browser: http://liveweb.be/awstats/hello.pl
returns : blank page

no errors in log.

// i forgot in previous test, to make the awstat link. so instead of the error could not find i get a blank page.

.htacces in astats dir :
Code:
Options -Indexes +ExecCGI
AddHandler cgi-script .pl
DirectoryIndex awstats.pl

RewriteEngine Off
RewriteCond %{HTTP_HOST} ^www.liveweb.be$ [NC]
RewriteRule ^(.*)$ http://liveweb.be/awstats/$1 [R=301,L]

I get the same result, no errors in apache
only for the cgi-bin i get the
[Thu May 05 14:15:01 2011] [error] [client 78.22.181.223] File does not exist: /usr/local/awstats-6.95/wwwroot/cgi-bin/hello.pl
in the domain log.

in the .htaccces of the cgi-bin there is only
Code:
Options -Indexes
 
There is also a httpd.conf_2.0 file in the /etc/httpd/conf/

Online is mentioned that centos uses httpd.conf for the apache2.0

content:
Code:
#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see 
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  

ServerRoot "/etc/httpd"
Listen 80

#LoadModule dummy_module /usr/lib/apache/mod_dummy.so
Include	/etc/httpd/conf/extra/httpd-phpmodules.conf

User apache
Group apache

ServerAdmin admin@localhost
DocumentRoot "/var/www/html"

<Directory /home/*>
    AllowOverride All
    Options -MultiViews -Indexes FollowSymlinks IncludesNoExec +Includes
<Limit GET POST OPTIONS PROPFIND>
    Order allow,deny
    Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
    Order deny,allow
    Deny from all
</LimitExcept>
</Directory>

<Directory />
    Options All
    AllowOverride All
</Directory>

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
   <IfModule mod_suphp.c>
        suPHP_Engine On
        suPHP_UserGroup webapps webapps
	SetEnv PHP_INI_SCAN_DIR
   </IfModule>
</Directory>

<IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.shtml index.php index.php5 index.php4 index.php3 index.phtml index.cgi
</IfModule>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

ErrorLog /var/log/httpd/error_log
LogLevel warn

#replace %b with %O for more accurate logging
<IfModule mod_logio.c>
    LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %O" common
    LogFormat "%O %I" bytes
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>

    CustomLog /var/log/httpd/access_log common

<IfModule mod_alias.c>
    # Include some DirectAdmin alias
    Include conf/extra/httpd-alias.conf
</IfModule>

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

DefaultType text/plain

<IfModule mod_mime.c>
    TypesConfig conf/mime.types
    AddType application/x-gzip .tgz
    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddHandler cgi-script .cgi
    AddHandler type-map var
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
	AddType video/x-ms-asf .avi
	AddType video/mpeg .mpg
	AddType video/mpeg .mpeg
	AddType video/quicktime .mov
	AddType video/x-ms-wmv .wmv
</IfModule>

#EnableMMAP off
#EnableSendfile off

#######################################################################################
# Do not change anything in included files, because they are rewritten by DirectAdmin #
#######################################################################################

# This is needed for PHP
Include conf/extra/httpd-php-handlers.conf

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

# Multi-language error messages
Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
Include conf/extra/httpd-autoindex.conf

# Language settings
Include conf/extra/httpd-languages.conf

# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf

# Various default settings
Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf

# Deflate module settings
Include conf/extra/httpd-deflate.conf

# All the DirectAdmin vhosts
Include conf/extra/directadmin-vhosts.conf

# All suPHP directives
Include conf/extra/httpd-suphp.conf

# For user configurations not maintained by DirectAdmin. Empty by default.
Include conf/extra/httpd-includes.conf

#######################################################################################
# End of included files that are rewritten by DirectAdmin                             #
#######################################################################################

<IfModule mod_ssl.c>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
 
Try to check the log for the single domain of apache.

Code:
/var/log/httpd/domains/DOMAINNAME.error.log

I did...

like already mentioned :

Code:
[Thu May 05 14:00:31 2011] [error] [client 78.22.181.223] File does not exist: /usr/local/awstats-6.95/wwwroot/cgi-bin/hello.pl
[Thu May 05 14:03:45 2011] [error] [client 78.22.181.223] File does not exist: /usr/local/awstats-6.95/wwwroot/cgi-bin/hello.pl
[Thu May 05 14:06:07 2011] [error] [client 78.22.181.223] File does not exist: /usr/local/awstats-6.95/wwwroot/cgi-bin/hello.pl
[Thu May 05 14:15:01 2011] [error] [client 78.22.181.223] File does not exist: /usr/local/awstats-6.95/wwwroot/cgi-bin/hello.pl
[Thu May 05 15:03:02 2011] [error] [client 78.22.181.223] File does not exist: /usr/local/awstats-6.95/wwwroot/cgi-bin/hello.pl
[Thu May 05 15:15:51 2011] [error] [client 78.22.181.223] File does not exist: /usr/local/awstats-6.95/wwwroot/cgi-bin/hello.pl

And this error is when i try to browse to http://www.liveweb.be/cgi-bin/hello.pl
 
the .pl file was empty on the server, but fixed it.

In now get the source of the file when browsing domain/awastats/hello.pl

file not found when trying to get domain/cgi-bin/hello.pl
 
i dont get why search for the hello.pl in /usr/local/awstats but maybe i didnt understand well ur problem, not quite good on perl/cgi sorry

But if you want me to take a look on ur box to try find out the problem just contact me, no problem

Regards
 
Back
Top