New versions and FAQ at http://awstats.sourceforge.net

Where stuff ends up

I used yum install awstat to get started.

Folder Contents
/etc/awstats/awstats.tighar.confconfiguration file
/usr/share/awstatsthe basic tools and utilities
/usr/share/awstats/wwwroot/cgi-binlocation of awstats.pl
/var/lib/awstatsdatabase
  • DRAT! I'm getting bad links from some of the analysis pages because I don't have ”.org” somewhere in my setup.
  • Later: AWstat can be set up to purge the log file after it is analyzed.
  • I copied the contents of /usr/share/awstats/wwwroot/ to /var/www/html/cgi-local and /var/www/html/logstats.

Catching up with old logs

After deleting the current index in /var/lib/awstats, I ran the following commands. The old logs must be scanned in chronological order.

perl /var/www/html/cgi-local/awstats.pl -config=tighar -update -LogFile=/var/log/httpd/access_log-20091004

perl /var/www/html/cgi-local/awstats.pl -config=tighar -update -LogFile=/var/log/httpd/access_log-20091011

perl /var/www/html/cgi-local/awstats.pl -config=tighar -update -LogFile=/var/log/httpd/access_log-20091018

perl /var/www/html/cgi-local/awstats.pl -config=tighar -update -LogFile=/var/log/httpd/access_log-20091025

perl /var/www/html/cgi-local/awstats.pl -config=tighar -update -LogFile=/var/log/httpd/access_log

This just updates the database:

perl /var/www/html/cgi-lcoal/awstats.pl -config=tighar -update

awstats_buildstaticpages.pl

awstats_buildstaticpages allows you to launch AWStats with -staticlinks option

to build all possible pages allowed by AWStats -output option.

Usage:

awstats_buildstaticpages.pl (awstats_options) [awstatsbuildstaticpages_options]

where awstats_options are any option known by AWStats

-config=configvalue is value for -config parameter (REQUIRED)

-update option used to update statistics before to generate pages

-lang=LL to output a HTML report in language LL (en,de,es,fr,…)

-month=MM to output a HTML report for an old month=MM

-year=YYYY to output a HTML report for an old year=YYYY

and awstatsbuildstaticpages_options can be

-awstatsprog=pathtoawstatspl gives AWStats software (awstats.pl) path

-dir=outputdir to set output directory for generated pages

-builddate=%YY%MM%DD Used to add build date in built pages filenames

-staticlinksext=xxx For pages with .xxx extension instead of .html

-buildpdf[=pathtohtmldoc] Build a PDF file after building HTML pages.

Output directory must contain icon directory when this option is used.

cron entry

Command for cron job: 5:00 AM, 10:50 AM, 4:50 PM, 10:50 PM Central Time.

So the updated stats should be ready by 11 AM, 5 PM, 11 PM.

crontab -e calls @#$%*&! vi editor.

0 5 * * * perl /usr/share/awstats/tools/awstats_buildstaticpages.pl -config=tighar -update -dir=/var/www/html/logstats >/dev/null 2>&1

50 10 * * * perl /usr/share/awstats/tools/awstats_buildstaticpages.pl -config=tighar -update -dir=/var/www/html/logstats >/dev/null 2>&1

50 16 * * * perl /usr/share/awstats/tools/awstats_buildstaticpages.pl -config=tighar -update -dir=/var/www/html/logstats >/dev/null 2>&1

50 22 * * * perl /usr/share/awstats/tools/awstats_buildstaticpages.pl -config=tighar -update -dir=/var/www/html/logstats >/dev/null 2>&1

Runaway archive?

3,087,233,837 bytes = 2.88 GB

I'd say that's more information than we need!

/etc/awstats/awstats.tighar.conf:

  • PurgeLogFile=1 should help … Nope. I had that set already.
  • ArchiveLogRecords=0 maybe.

Awstats not working

Problem: updates stopped working, despite MUCH new data in access_log.

Solution: Change EnableLockForUpdate=1 to EnableLockForUpdate=0.

An update must have been interrupted by a fatal error of some kind, and the process was never unlocked.

Deeper solution: Name of the awstats lock file: /tmp/awstats.tighar.lock

rm /tmp/awstats.tighar.lock

 
tighar/awstats.txt · Last modified: 2012/03/22 21:47 by moleski
 
Recent changes RSS feed Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki