New versions and FAQ at http://awstats.sourceforge.net
I used yum install awstat
to get started.
Folder | Contents |
---|
/etc/awstats/awstats.tighar.conf | configuration file |
/usr/share/awstats | the basic tools and utilities |
/usr/share/awstats/wwwroot/cgi-bin | location of awstats.pl |
/var/lib/awstats | database |
/usr/share/awstats/wwwroot/
to /var/www/html/cgi-local
and /var/www/html/logstats.
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
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.
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
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.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