Resolution
Plesk's 'statistics' utility does not use info from previous months' log records and builds AWstats pages for the current month only. To build AWstats pages for previous months follow these steps:0) define these environment variables according to requirements: set needed domain name
export vhost_name=SET.REAL.DOMAIN.NAME.HEREand set the following ones pretty much the same:
export AWSTATS_BIN_D=`grep ^AWSTATS_BIN_D /etc/psa/psa.conf | awk '{print $2}'`
export HTTPD_VHOSTS_D=`grep ^HTTPD_VHOSTS_D /etc/psa/psa.conf | awk '{print $2}'`
export PRODUCT_ROOT_D=`grep ^PRODUCT_ROOT_D /etc/psa/psa.conf | awk '{print $2}'`
export awstats=${AWSTATS_BIN_D}/awstats.pl
export awstats_gen_opts="-staticlinks -configdir=${PRODUCT_ROOT_D}/etc/awstats -config=${vhost_name}-http"1) check if there are *.txt files in statistics/webstat directory for previous months. If there are and you wish to build statistic pages using the information stored in these data files then skip to step #4
2) remove all *.txt files from the statistics/webstat directory:
find $HTTPD_VHOSTS_D/$vhost_name/statistics/webstat -name '*.txt' -exec rm -f '{}' \;3) find the necessary log file and analyze it with awstats:
$awstats $awstats_gen_opts -LogFile=$HTTPD_VHOSTS_D/${vhost_name}/statistics/logs/access_log.processed4) create missing time stamped (in format 'YYYY-MM') directories for the period of processed log file in statistics/webstat subdirectory of virtual host:
for y in 2007 2008 ; do for m in `seq 1 12` ; do mkdir ${HTTPD_VHOSTS_D}/${vhost_name}/statistics/webstat/$y-$(printf "%.2d" $m) ; done ; done5) run this cycle to build statistics pages:
for y in 2007 2008 ; do \
for m in `seq -w 1 12` ; do \
dest_dir=$HTTPD_VHOSTS_D/$vhost_name/statistics/webstat/$y-$m ; \
$awstats $awstats_gen_opts -month=$m -year=$y -output > $dest_dir/awstats.${vhost_name}-http.html ; \
ln -s $dest_dir/awstats.${vhost_name}-http.html $dest_dir/index.html ; \
for output in alldomains allhosts lasthosts unknownip allrobots lastrobots session urldetail urlentry urlexit osdetail unknownos refererse refererpages keyphrases keywords errors404 ; do \
$awstats $awstats_gen_opts -month=$m -year=$y -output=$output > $dest_dir/awstats.${vhost_name}-http.$output.html ; \
done ; \
done ; \
done6) run 'statistics' command to update the upper frame navigation menu with month listing:
$PRODUCT_ROOT_D/admin/sbin/statistics --calculate-one --domain-name=$vhost_name