Symptoms
-
Unable to open AWStats web statistics page with the following error:
404 Not Found
The requested document was not found on this server
Web Server at example.com -
Following directories are specified in
/etc/psa/psa.conf
file for AWStats scripts:# egrep “AWSTATS_BIN_D|AWSTATS_TOOLS_D” /etc/psa/psa.conf
AWSTATS_BIN_D /usr/share/awstats/wwwroot/cgi-bin
AWSTATS_TOOLS_D /usr/share/awstats/tools -
The Statistics Rebuild Script fails with the following error:
./rebuild_awstats.sh: line 210: /usr/share/awstats/tools/logresolvemerge.pl: No such file or directory
ERROR: failed to merge access_log*. Skipping domain.
ERROR /usr/share/awstats/wwwroot/cgi-bin/awstats.pl cannot be executed. -
Web stat files have a huge size:
# ls -lhS /var/www/vhosts/system/example.com/logs/ | head
…
-rw——- 1 root root 35G Aug 21 17:14 access_ssl_log.webstat
-rw——- 1 root root 2.4G Aug 21 15:33 access_log.webstat
-rw-r–r– 1 root root 7.0M Aug 21 15:33 access_ssl_log.stat
-rw-r–r– 2 root root 5.7M Aug 21 17:39 access_ssl_log
… - This issue can occur after upgrade to Plesk Obsidian.
Cause
Product issue:
-
#PPPM-11342 “Accessing AWStats data for domains hosted in Plesk no longer results in the “404 Not Found” error.”
Fixed in:- Plesk Obsidian 18 February 2020 (Linux)
Resolution
Workaround
As a workaround, set the correct AWStats paths manually by following the steps below:
-
Log in the server via SSH.
-
Change the
/etc/psa/psa.conf
file according to the script location:for RHEL-based OSes:
-
Check the packager of
awstats
package:# rpm -qi awstats | grep Packager
Note: If the Packager isn’t Plesk, check this knowledge base article for the solution.
-
Adjust Awstats variables as follows:
# egrep “AWSTATS_BIN_D|AWSTATS_TOOLS_D” /etc/psa/psa.conf
AWSTATS_BIN_D /var/www/cgi-bin/awstats
AWSTATS_TOOLS_D /usr/share/awstats
for Debian-based OSes:
# egrep “AWSTATS_BIN_D|AWSTATS_TOOLS_D” /etc/psa/psa.conf
AWSTATS_BIN_D /usr/lib/cgi-bin
AWSTATS_TOOLS_D /usr/share/awstats/toolsNote: For Ubuntu 14.04 the following symlink should be created:
# ln -s /usr/lib/plesk-9.0/logresolvemerge /usr/share/doc/awstats/examples/logresolvemerge.pl
-
-
Rebuild statistics as described in the article: How to recalculate AWStats statistics from logs for previous months