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

 perl awstats_buildstaticpages.pl -config=tighar.org -update -staticlinks -dir=/var/www/html/tstats

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: 4:00 AM, 9:50 AM, 3:50 PM, 9:50 PM Mountain Time.

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

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

crontab all by itself reads input from the console. Don't use CTRL-D to end input–that will erase the current crontab file! Use CTRL-C to back out, then use crontab -e to edit the current file with the @#$%*&! vi editor.

crontab -l lists all root crontab jobs

30 1 * * Mon /sbin/reboot
0 4 * * Sun /var/www/html/aw/backup.sh
0 4 * * * /usr/share/awstats/tools/awstats_buildstaticpages.pl -config=tighar.org -update -awstatsprog=/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -dir=/var/www/html/tstats >/dev/null 2>&1

50 9 * * * /usr/share/awstats/tools/awstats_buildstaticpages.pl -config=tighar.org -update -awstatsprog=/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -dir=/var/www/html/tstats >/dev/null 2>&1

50 15 * * * /usr/share/awstats/tools/awstats_buildstaticpages.pl -config=tighar.org -update -awstatsprog=/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -dir=/var/www/html/tstats >/dev/null 2>&1

50 21 * * * /usr/share/awstats/tools/awstats_buildstaticpages.pl -config=tighar.org -update -awstatsprog=/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -dir=/var/www/html/tstats >/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: 2017/07/13 20:33 (external edit)
 
Recent changes RSS feed Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki