• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Awstats not building static pages

TeemuP

New Pleskian
I have an issue with Plesk and Awstats not building the html pages for website statistics. Problem is server-wide i.e. it effects all domains.

I've tried to manually run the /usr/local/psa/admin/sbin/statistics with every possible options but all that happens is that awstats calculates new stats to the vhosts /var/www/vhosts/system/domain.tld/statistics/webstat/awstatsMMYYYY.domain.tld-http.txt file. Nothing is put into the /var/www/vhosts/system/domain.tld/statistics/webstat/YYYY-MM folder which should contain the static html pages.

Example listings:
Code:
# ll /var/www/vhosts/system/<domain.tld>/statistics/webstat 
total 80
drwxr-xr-x 4 root root  4096 Nov  5 10:58 ./
dr-xr-x--- 6 root psaserv  4096 Oct 23 12:36 ../
drwxr-xr-x 2 root root  4096 Oct 23 13:12 2014-10/
drwxr-xr-x 2 root root  4096 Nov  5 10:56 2014-11/
-rw-r--r-- 1 root root  24761 Nov  1 06:25 awstats102014.<domain.tld>-http.txt
-rw-r--r-- 1 root root  17558 Nov  5 10:58 awstats112014.<domain.tld>-http.txt
lrwxrwxrwx 1 root root  7 Nov  5 10:58 current -> 2014-11/
-rw-r--r-- 1 root root  6874 Nov  5 10:58 dnscachelastupdate.<domain.tld>-http.hash
-rw-r--r-- 1 root root  457 Nov  5 10:58 index.html
-rw-r--r-- 1 root root  937 Nov  5 10:58 nav.html

# ll /var/www/vhosts/system/<domain.tld>/statistics/webstat/current 
total 8 
drwxr-xr-x 2 root root 4096 Oct 23 13:55 ./ 
drwxr-xr-x 3 root root 4096 Oct 23 13:23 ../

I was able to create the static pages by running Awstats directly:
Code:
# /usr/share/awstats/tools/awstats_buildstaticpages.pl -awstatsprog=/usr/lib/cgi-bin/awstats.pl -configdir=/usr/local/psa/etc/awstats -config=<domain.tld>-http -dir=/var/www/vhosts/system/<domain.tld>/statistics/webstat/current

So things I have already checked:
- Awstat paths in /etc/psa/psa.conf are correct
- Domain configs are ok as awstat can create the stats data and awstats_buildstaticpages.pl can can create the pages just fine
- File permissions are ok

I just cannot figure what the problem is. /usr/local/psa/admin/sbin/statistics doesn't give any errors but on the other hand it doesn't have a debug option either which might be useful.

OS: Ubuntu 14.04.1 LTS
Plesk version: 12.0.18 Update #22

Regards,
Teemu
 
Is there a manual for the statistics programm?
Code:
/usr/local/psa/admin/sbin/statistics --generate-domain-webstat --domain-name=MYDOMAIN
runs for a minute, but doesn't do anything at all?
 
I'm having the same problem (But on Plesk 10).

In my case, the value of stat_ttl in dom_param for the domains in question is 3 rather than the wanted 12.

If you take a look at http://kb.odin.com/en/6246 you'll see more detail on the stat_ttl issue.

You'll see that there is a stat_ttl value set in the misc table, and a domain-specific value set in dom_param (as well as a value in your service plans).

The KB indicates that changing the value set via the Service Plan does NOT change the value in dom_param for all domains associated with that service plan, and this is where my problems started as far as I can tell.

So it *might* be that if stat_ttl is, say, 3 in dom_param for the domain, but set to 12 elsewhere (e.g. service plan?) awstats will create the text file (12 months worth), but will not create the static pages for more than 3 months (plus the current month, so you see 4 items in the list).

This is a total and utter guess on my part, and I may be way off the mark.

I have a pathological fear of editing tables in the Plesk database, but in theory you'd want to:
Code:
update dom_param set val=12 where param='stat_ttl'

in the PSA database, to set everything to 12 (1 year). Then I wonder if those stats text files might get processed by awstats.
Again I want to emphasize this is total guess and I'm too chicken even to try it :)

If you do mess with the PSA database, please please make a backup first in case it all goes wrong!
 
OK, here's a bit of an update.

I changed all the values of stat_ttl in dom_params to 12 and run the statistics program for one domain and .... no change (at least on 10.4.4 -- I know this is the 12.x section of the forum so I need to emphasize this)

But then I did succeed in rebuilding the static pages!
First, I found this: http://kb.odin.com/en/115476
Unfortunately, this script only rebuilds things based on the date range of the data available in the httpd logfiles. Since this will be less than the range of data in the unprocessed awstats files, you won't get any benefit.

However, I then found this post:
First, take a look here http://talk.plesk.com/threads/how-t...es-of-migrated-awstats-database-files.299510/

Right at the bottom, there is a modified version of the script. You will find, on line 294 a line starting with date_range

If you modify this to either match the range of dates on the files you have, or if you have a lot of them you can change it to the past X months, e.g. like this:
date_range=`make_date_range "12/2013-02/2015"`

And then run the script (you have to specify a domain - you can't use the -A option) your static files get rebuilt and all is well again!

But of course I'm aware than this post does not necessarily answer the question of why the static files were not being built all of a sudden for some users, and I rather think I'm posting this in the wrong place as an answer to the wrong question sort of thing. Sorry for any confusion!
 
Back
Top