From b57ae22248b000d267bff855f8c7c106b5f1ddbf Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 15 Dec 2011 10:22:55 -0500 Subject: [PATCH] Update AWStats post to use -configdir. --- posts/AWStats.mdwn | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/posts/AWStats.mdwn b/posts/AWStats.mdwn index 4885411..f02f68a 100644 --- a/posts/AWStats.mdwn +++ b/posts/AWStats.mdwn @@ -40,30 +40,29 @@ Because `awstats.pl` can be invoked interactively through your browser (depending on how you have it installed), it has a fairly restricted path. In order to run awstats on files in a random directory (e.g. for processing your server's logs on another host) you should -use the full path to your config file. Here's an example of parsing -the all the archived logs (my logs are archived as -`access_log-YYYYMMDD.gz`): +use the `-configdir` option. Here's an example of parsing the all the +archived logs (my logs are archived as `access_log-YYYYMMDD.gz`): - $ for log in example-logs/access_log-*.gz; do awstats.pl -config="${PWD}/awstats.example.conf" -LogFile="gzip -cd ${log} |"; done + $ for log in example-logs/access_log-*.gz; do awstats.pl -configdir="${PWD}" -config example -LogFile="gzip -cd ${log} |"; done I also analyze logs from another host, whose logs are archived weekly as `access_log.2.gz`, `access_log.3.gz`, etc. To parse the last year of those archived logs, use something like: - $ for i in $(seq 52 -1 2); do awstats.pl -config="${PWD}/awstats.example.conf" -LogFile="gzip -cd example-logs/access_log.${i}.gz |"; done + $ for i in $(seq 52 -1 2); do awstats.pl -configdir="${PWD}" -config=example -LogFile="gzip -cd example-logs/access_log.${i}.gz |"; done After working through the archived logs, you can process the current log file: - $ awstats.pl -config="${PWD}/awstats.example.conf" + $ awstats.pl -configdir="${PWD}" -config=example Once all the logs have been processed, run - $ awstats.pl -config="${PWD}/awstats.example.conf" + $ awstats.pl -configdir="${PWD}" -config=example -update To generate the report, run - $ awstats.pl -config="${PWD}/awstats.example.conf" -output + $ awstats_buildstaticpages.pl -configdir="${PWD}" -config=example -dir=html [AWStats]: http://www.awstats.org/ -- 2.26.2