20130301 jawstats and me - plembo/onemoretech GitHub Wiki

title: JAWStats and me link: https://onemoretech.wordpress.com/2013/03/01/jawstats-and-me/ author: phil2nc description: post_id: 4414 created: 2013/03/01 04:11:14 created_gmt: 2013/03/01 08:11:14 comment_status: closed post_name: jawstats-and-me status: publish post_type: post

JAWStats and me

JAWStats is front end for the ubiquitous AWStats web server log analysis package. It hasn't been updated since 2011 and earlier versions apparently have issues with php 5.3+. The main problem with JAWStats is that like many software packages, it is inadequately documented and not at all intuitive in its configuration. It also seems to have forked at some point and there is a slightly newer 2011 version of the last release from 2009 (bearing the same version number) sitting in a number of git repositories. The version I finally got working is mimesis/jawstats. This config assumes a Fedora 17 Linux install of the Apache HTTP Server, php 5.4.11 and AWStats as it ships from rpmforge. First the good part, here's my working config.php from an installation I did to /opt/jawstats on my web server at home:

 "/var/lib/awstats/",
    "statsname"   => "awstats[MM][YYYY].www.example.com.txt",
    "updatepath"  => "/usr/share/awstats/wwwroot/cgi-bin/awstats.pl",
    "siteurl"     => "http://www.example.com",
    "sitename"    => "www.example.com | Statistics",
    "theme"       => "default",
    "fadespeed"   => 250,
    "password"    => "myadminaccount",
    "includes"    => "",
    "language"    => "en-gb"
  );
?>

Now for the steps: 1. Download jawstats-master.zip from here. This is a newer build (dated from 2011) than what is available on jawstats,com (2009). 2. Unzip and move the resulting jawstats-master folder to /opt/jawstats. 3. Go in and fix the permissions by: (a) Making apache the owner of everything ("chown -R apache:apache /opt/jawstats"); (b) Removing the executable bit from all files (these are .php scripts, not perl):

find . -type f -name "*.*" -exec chmod ugo-x {} ;

4. Add an Alias directive to /etc/httpd/conf/httpd.conf in the virtual host for the url that you'll access to see your stats (in this example the ServerName of that vhost is host1.example.com -- I usually don't expose stats packages through the vhost being reported on):

Alias /jawstats "/opt/jawstats"

5. Make sure that short_open_tag is "On" and a time zone is set in /etc/php.ini:

short_open_tag = "On"
* * *
date.timezone = UTC

6. Reload the web server config to make these changes effective:

service httpd reload

7. Finally go to http://host1.example.com/jawstats to see your stats. To cover multiple sites on the same box you could create a subdirectory for each site under /opt/jawstats with its own copy of the code and config.php.

Copyright 2004-2019 Phil Lembo