Patched AWStats package


The normal setup of AWStats with cPanel relies on a stats update run immediately before the Apache log file is archived and flushed. If this update run isn't done all traffic after the last update is not recorded in the stats files. For some unknown reason recent installations of cPanel don't update the stats as part of the log archive run. This is bad enough when the logs are archived on a monthly basis and a total disaster when the archiving is done on a daily basis.

The modified version of awstats.pl in this package is called awstats1.pl and runs awupdate.pl immediately before processing the log file. The awupdate.pl script builds a log containing all lines from the available archives and the live log file. The update script maintains an index file listing the names and details of all archives used to build the log file. Note that the log file will get rather large. The inclusion of lines from old archives depends on the archives having the standard names. To avoid this old data being included the old archives can be removed or renamed.

In the text below MYDOMAIN should be replaced by the domain name (e.g. example.com) for the specific installation.

This package should be installed in the www/stats directory. It expects the logs files to be in ../../logs and the domlog file to be in ../../access-logs. The maintained index file is ../../logs/MYDOMAIN.idx. The full log file is called ../../logs/MYDOMAIN.

Once the package has been unzipped to the www/stats directory the www/stats/awstats1.conf file must be changed by replacing all occurrences of the literal MYDOMAIN with the site domain name. The reverse DNS feature is enabled by default and can be disabled by changing the ReverseDNS setting in the .conf file to 0.

The URL to display the stats is <http://MYDOMAIN/stats/>. There is no automatic update so the "Update Now" button must be clicked to update the statistics files and display. For normal installations the www/stats directory can be password protected by the Password Protected Directories facility in cPanel.

Update 2009-09-02 : Fixed bug that reset the logs on month change when stats run done before logs archive for new month created.

Visit AWStats site for downloads and documentation.

Download patched AWStats package (2468kB) dated 2009-09-02

Last Modified : 2009-09-02