Configure awstats for zeus

awstats

Install and configure awstats on a zeus webserver.

Install awstats

Download and extract awstats to /usr/local

Rename extracted directory to awstats

Configure awstats

Copy the default configuration file awstats/wwwroot/cgi-bin/awstats.model.conf to /etc/awstats/. Rename this file by replacing ‘model’ with your website name, ie awstats.www.gemini.edu.

Open this file and edit the following:

LogFile="/export/web/docs/logs/gemini.edu/requests.log.%YYYY%MM%DD"
SiteDomain="gemini.edu"
HostAliases="gemini.edu www.gemini.edu 127.0.0.1 localhost"
AllowToUpdateStatsFromBrowser=1

Move the DirData from the awstats directory to your site log directory:

mv awstats/DirData /export/web/mysite/logs/awstatsDirData

Modify the /etc/awstats configuration file with new location:

DirData="/export/web/mysite/logs/awstatsDirData"

Configure awstats_misc_tracker.js

Enabling the javascript code to run will track useful things about a client like screen resolution, and browser plugins.

Add the following to the head element your root index web page:


Modify the config script:

MiscTrackerUrl="/awstats/js/awstats_misc_tracker.js"
ShowScreenSizeStats=1
ShowMiscStats=1

Configure Geographical Tracking

Install the Geo::IPfree perl module using cpan:

install Geo::IPfree

Modify the config script:

LoadPlugin="geoipfree"

Configure zeus logging

Make sure the log format is NCSA Combined

Configure zeus cgi

You must create a directory alias for the awstats cgi-bin:

Requests for…
/stats/cgi-bin/
Are mapped to…
/usr/local/awstats/wwwroot/cgi-bin/

Configure zeus url mappings

There are several aliases required for awstats directories:

Requests for…Are mapped to…

/awstats/ /usr/local/awstats/wwwroot/
/stats/ /usr/local/awstats/wwwroot/
/icon/ /usr/local/awstats/wwwroot/icon/

Add awstats in cron

#run awstats hourly
0 * * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=gemini.edu

Import log files into awstats

To import log files, each log file must be imported chronologically. If not, the stats for the month will be inaccurate:

awstats.pl -config=www.gemini.edu -LogFile=/export/web/docs/logs/gemini.edu/requests.log.20060901