Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

AWSTATS.PL not executing in Browser

Posted on 2012-04-05
3
Medium Priority
?
3,246 Views
Last Modified: 2013-12-25
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:

http://stats.server.com/cgi-bin/awstats.pl?config=awstats.www.domain.com.conf

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.

#!/usr/bin/perl
#------------------------------------------------------------------------------
# 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;

#$|=1;
#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/;
$REVISION = $1;
$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.
Chris
0
Comment
Question by:kenwardc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
torakeshb earned 2000 total points
ID: 37810271
you need to update the apache with

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

an eg would be

<Directory /home/rakesh/public_html/cgi-bin>
Options ExecCGI
SetHandler cgi-script
</Directory>
0
 
LVL 7

Expert Comment

by:torakeshb
ID: 37810282
0
 

Author Closing Comment

by:kenwardc
ID: 37810416
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.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question