• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3437
  • Last Modified:

AWSTATS.PL not executing in Browser

Hi Folks

Here's one that has me stumped. Hope you can help.

I've tried setting up AWSTATS within Webmin but it's horrible and doesn't work correctly even though I following the examples as per. The config file is all over the place and when I select to view the generated stats "no file found". BARF!

So... I decided to do it the hard way and have created a website called "stats" on the server. Within that I've put a cgi-bin folder which contains awstats.pl and the permissions are RWXR-XR-X.

The stats are being generated correctly and the database file is being placed where I want it. The issue? Although the awstats.pl file is executable from the command line, it isn't from the browser when I point at:


What I get instead of the data from the data file is a listing of the awstats.pl script on the screen. Interestingly, whether I put the URL in as above or if I leave out everything after awstats.pl, the result is exactly the same... here is a sample of some of it - too large to copy all in here... so there is no execution of the file and the argument after the '?' is being ignored.

# Free realtime web server logfile analyzer to show advanced web statistics.
# Works from command line or as a CGI. You must use this script as often as
# necessary from your scheduler to update your statistics and from command
# line or a browser to read report results.
# See AWStats documentation (in docs/ directory) for all setup instructions.
# $Revision: 1.971 $ - $Author: eldy $ - $Date: 2010/10/16 17:24:03 $
require 5.007;

#use warnings;            # Must be used in test mode only. This reduce a little process speed
#use diagnostics;      # Must be used in test mode only. This reduce a lot of process speed
use strict;
no strict "refs";
use Time::Local
  ; # use Time::Local 'timelocal_nocheck' is faster but not supported by all Time::Local modules
use Socket;
use Encode;

# Defines
use vars qw/ $REVISION $VERSION /;
$REVISION = '$Revision: 1.971 $';
$REVISION =~ /\s(.*)\s/;
$VERSION  = "7.0 (build $REVISION)";

# ----- Constants -----
continues to end of file.

Any help would be appreciated. I feel I almost have this licked but need to know how to execute the awstats.pl script from a browser.

Many thanks.
  • 2
1 Solution
you need to update the apache with

<Directory <Path to AWSTAT.PL>
Options ExecCGI
SetHandler cgi-script

an eg would be

<Directory /home/rakesh/public_html/cgi-bin>
Options ExecCGI
SetHandler cgi-script
kenwardcAuthor Commented:
BANG ON! Thanks very much - I now have it working but need the icons to work. Possibly a new question but thank you so much for the answer,  torakeshb.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now