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:

    "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.

This entry was posted in Uncategorized on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).