(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/