I use AWStats to analyse logs on several web sites that I manage. After a recent upgrade to Debian 7.0 “Wheezy” I was puzzled to find that my web stats were no longer being updated.
I verified that the Cron job which runs the update script was running. I verified that if I ran the same command from the console, it ran correctly. I verified this even using sudo to run with the same permissions as Apache. I also noted that the update button on the stats pages worked correctly. An odd problem.
This is how it rested for a while, and I manually updated the stats. It was annoying though, so I took a closer look.
First, I amended one of the Cron jobs so that it output to a file. Reading the file after the next failed update, I could see the error message:
Error: LogFile parameter is not defined in config/domain file
Setup file, web server or permissions) may be wrong.
I knew the config file was fine, but checked anyway, and of course the LogFile was specified OK.
It was a clue though. Eventually I came across this bug report by Simone Capra:
Hi all, i’ve found a problem:
When run from another perl program, it finds a config file that doesn’t exist!
I applied the suggested fix in awstats.pl, changing:
if (open( CONFIG, "$SiteConfig" ) ) {
to
if ($SiteConfig=~ /^[\\/]/ && open( CONFIG, "$SiteConfig" ) ) {
Presto, everything is running OK.