Applicable to:
- Plesk for Linux
Symptoms
-
Unable to open AWStats web statistics page with the following error:
CONFIG_TEXT: 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:
CONFIG_TEXT: ./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
Comments
7 comments
Not perfect.
I was able to find the proper directories on my CentOS 7.4 thanks to this guide.
Wrong dirs:
#AWSTATS_BIN_D /var/www/cgi-bin/awstats
#AWSTATS_TOOLS_D /usr/share/awstats
Good dirs:
AWSTATS_BIN_D /usr/share/awstats/wwwroot/cgi-bin/
AWSTATS_TOOLS_D /usr/share/awstats/tools
Then I had to recalculate stats for the domains:
/usr/local/psa/admin/bin/web_statistic_executor --calculate-domain mydomain.tld
Though, it is not perfect: if the current date seems to work, previous months are not updated; possibly because logs don't go that far in the past.
Hello @Shawn, thank you for the feedback.
Let us know if you have questions about this issue and its solution.
I have been able to verify that since November, since I updated Plesk from Onyx, to Obsidian, webstats are not generated, and my file access_log.webstat has a size of 320 MB, and the access_ssl_log.webstat is 2 GB.
I tried to do this fix, but doest'n works. My server uses CentOS 6 with Plesk Obsidian. The directories are correct, they are the same as Robin Labadie says. But, when executing the command to recalculate the statistics, it tells me the following:
unrecognised option '--calculate-domain'
I also tried this command (from this article https://support.plesk.com/hc/en-us/articles/213901965) :
./rebuild_awstats.sh -R example.com
But returns this error:
ERROR /usr/share/awstats/wwwroot/cgi-bin/awstats.pl cannot be executed.
@Rafa
Try the following one instead:
Hi Denis! Thanks for the reply!
I executed the command, and returned this:
Executing logs preparation...
-----[ (MY DOMAIN)
Webstat: none
My directories in psa.conf, according to this guide, they are correct
AWSTATS_BIN_D /usr/share/awstats/wwwroot/cgi-bin
AWSTATS_TOOLS_D /usr/share/awstats/tools
I tried reinstall Awstats (https://support.plesk.com/hc/en-us/articles/213930765?page=1#comment_115000146045), but it still doesn't work.
I tried tu rebuild Awstats (https://support.plesk.com/hc/en-us/articles/213901965-How-to-recalculate-AWStats-statistics-from-logs-for-previous-months) and I receive the message /usr/share/awstats/wwwroot/cgi-bin/awstats.pl cannot be executed. In that article, say that I have to go to this same article where we are talking in search of the solution; I'm in a Plesk articles loop.
I have tried all the solutions, but the truth is that what has happened is that since I updated from Onyx to Obsidian, the statistics don't work and this problem was created.
Hi Rafa,
Does the domain has set a Statistics engine?
Verify the next:
Please sign in to leave a comment.