Awstats: Error: Couldn’t open server log file … … access.log …. No such file or directory

1 minute read

After an upgrade from Debian 3.1 (sarge) to Debian 4.0 (etch), awstats stopped automatically updating.

Awstats was complaining that the log files could found. By logging in to the server, user www-data was able to open the files, but still awstats was complaining.

After upgrading, the behaviour of awstats seem to have changed a bit. Updating the stats using resulted in the following error when using the command line:

[email protected]:~$ /usr/share/doc/awstats/examples/ now -awstatsprog=/usr/lib/cgi-bin/
/usr/lib/cgi-bin/ -update -configdir="/etc/awstats"
Update for config "/etc/awstats/"
With data in log file "/usr/share/doc/awstats/examples/ /var/log/apache2/access.log /var/log/apache2/access.log.1 |"...
Error: Couldn't open server log file "/usr/share/doc/awstats/examples/ /var/log/apache2/access.log /var/log/apache2/access.log.1 |" : No such file or directory
Setup ('/etc/awstats/' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

To work around this error, one of the possible reason (if you can confirm that user www-data can open the log files) is that does not get automatically executed, it is possible to force this by changing a line in /etc/awstats/ and change:

LogFile="/usr/share/doc/awstats/examples/ /var/log/apache2/access.log /var/log/apache2/access.log.1 |"


LogFile="perl /usr/share/doc/awstats/examples/ /var/log/apache2/access.log /var/log/apache2/access.log.1 |"

Please change the value of LogFile accordingly do your settings. Basically add perl at the beginning of the statement.

This fixed my issue, hopefully it will do the same for people reading this page :smile: