Awstats in Plesk
Awstats in Plesk
Awstats in Plesk
http://kb.parallels.com/en/114797
How to enable daily maintenance (statistics) script logging
APPLIES TO:
Parallels
Parallels
Parallels
Parallels
Plesk
Plesk
Plesk
Plesk
Panel
Panel
Panel
Panel
11.x
10.x
11.x
10.x
for
for
for
for
Linux
Linux
Windows
Windows
Linux
Replace the content of /etc/cron.daily/50plesk-daily with the below
content. Do not forget to back up the original file.
#!/bin/sh
exec 1>>/root/50plesk-daily.log
exec 2>&1
set -x
export PLESK_DEBUG_LEVEL=4
# install_statistics
/usr/local/psa/bin/sw-engine-pleskrun
/usr/local/psa/admin/plib/DailyMaintainance/script.php
# install_mysqldump
/usr/local/psa/bin/mysqldump.sh >/dev/null 2>&1
Debug logs will be collected in /root/50plesk-daily.log. Replace the
/etc/cron.daily/50plesk-daily file with the original one once you are
done monitoring.
Windows
- Terminate all hanging daily maintenance task processes
- Turn off the daily maintenance task in the Task Scheduler to avoid
interference from its side
Information
Since Parallels Plesk Panel 11, the DailyMaintenance task now has
options that allow you to execute separate maintenance tasks. This
provides an easy way to debug Micro-Update detection problems or
key update problems. You do not need to rerun the daily task as a
whole and wait for the statistics task to finish anymore. Here is a
usage example:
# /usr/local/psa/bin/sw-engine-pleskrun
/usr/local/psa/admin/plib/DailyMaintainance/script.php -h
o Usage: script.php [period|option]
o Period can be one of the following:
o
daily weekly monthly
o Option can be one of the following:
o
-h
usage screen
o
-l
list available tasks
o
-f <name>
execute only one task with name <name>
Let us imagine that we only want to rerun the key update task:
# /usr/local/psa/bin/sw-engine-pleskrun
/usr/local/psa/admin/plib/DailyMaintainance/script.php -l
o CheckForUpdates
o InstallUpdates
o update-keys
o plesk-usage
o autoreport
o sitebuilder
o mail-usage
o execute-statistics
o optimize-statistics
o analyse-domain-statistics
o analyse-client-statistics
o execute-spamtrain
o execute-glcleaner
o execute-apache-config-rotation
o ppsmbe-filesharing
o UpgradePanel
# export PLESK_DEBUG=1
# /usr/local/psa/bin/sw-engine-pleskrun
/usr/local/psa/admin/plib/DailyMaintainance/script.php -f updatekeys
o [Mon, 20 Aug 2012 11:11:03 +0700] > 0 Starting: Daily
Maintainance
o [Mon, 20 Aug 2012 11:11:03 +0700] > 0 == Begin Update keys
o [Mon, 20 Aug 2012 11:11:03 +0700] > 0 updating scheduled
keys
o [Mon, 20 Aug 2012 11:11:04 +0700] > 0 update resultCode=2
resultDesc=Key update disabled
o [Mon, 20 Aug 2012 11:11:04 +0700] > 0 == End Update keys
o [Mon, 20 Aug 2012 11:11:04 +0700] > 0 Finish: Daily
Maintainance
Daily maintenance script
root@server1 ~ # ps aux | grep Daily | grep pts/3
root
23689 0.0 0.1 206660 23232 pts/3 S+ Aug24 0:00
/usr/bin/sw-engine -c /opt/psa/admin/conf/php.ini
/usr/local/psa/admin/plib/DailyMaintainance/script.php -f executestatistics
Aw-stats configuration directories and then ran the daily
maintenance script to calculate statistics in the server.
root@server1 ~ # grep AWSTATS /etc/psa/psa.conf
AWSTATS_ETC_D /etc/awstats
AWSTATS_BIN_D /usr/lib/cgi-bin
AWSTATS_TOOLS_D /usr/share/awstats/tools
AWSTATS_DOC_D /usr/share/awstats
Calculate the statistics for all the domains:
root@server1 ~ # /usr/local/psa/admin/bin/statistics --calculate-all
Calculate the statistics for a domain
/usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=
Verified structure of the webstat directories on the file system
[root@david-host-me-uk ~]# find /var/www/vhosts/cruisecommunity.me.uk/statistics/webstat/ -type d
/var/www/vhosts/cruise-community.me.uk/statistics/webstat/
/var/www/vhosts/cruise-community.me.uk/statistics/webstat/2013-08
/var/www/vhosts/cruise-community.me.uk/statistics/webstat/2013-09
/var/www/vhosts/cruise-community.me.uk/statistics/webstat/2013-07
Recalculate using webstatmng
[root@david-host-me-uk ~]# /usr/local/psa/admin/bin/webstatmng
--calculate-rotated-statistics --stat-prog=awstats --domainname=cruise-community.me.uk
Create/Update database for config
"/usr/local/psa/etc/awstats/awstats.cruise-community.me.ukhttps.conf" by AWStats version 7.1.1 (build 1.989)
Recalculate AWstats statistics from logs for previous months
http://kb.parallels.com/en/5550
# wget
http://kb.parallels.com/Attachments/23491/Attachments/rebuild_aws
tats.zip
# unzip rebuild_awstats.zip
# chmod u+x rebuild_awstats.sh
# ./rebuild_awstats.sh
Algorithm
For each specified domain (or for all domains if the -A option used),
learn the log files' start date. Remove AWstats data files for months
covered by the log file and rebuild them with information from the
logs. Then build static pages with a statistics summary for every
month covered by the log files.
Alternatively, if the -F option is used, then all data files are removed
and new files are generated using information from the log files.
# ./rebuild_awstats.sh
Rebuild AWstats static pages from available log files.
Usage: ./rebuild_awstats.sh [options] [<domains...>]
Options:
-A
--all-domains
Process all domains. If this option is not specified, then list of
domains to process must be provided.
-F
--from-scratch
Remove contents of webstat/ and webstat-ssl/ directories
before
rebuilding statistics pages (originals are saved with numeric
suffix). Statistics will be rebuilt from logs only, only for
period covered by log files. If this parameter is not used, then
statistics is recalculated beginning on the month on which log
files
start (if log starts in the middle of the month, then statistics
for first half of the month will not be present.)
-h
--help
This message.
gayumbos.com\statistics\logs\W3SVC15010\extend4.log -year=2013
-month=09 -showcorrupted
perl awstats.pl -config=los-gayumbos.com
-DirData=C:\Inetpub\vhosts\los-gayumbos.com\statistics\webstat
-LogFile=C:\Inetpub\vhosts\losgayumbos.com\statistics\logs\W3SVC15010\extend4.log -year=2013
-month=09 -update
C:\inetpub\vhosts\enic-naric.net\statistics\logs\W3SVC32
C:\>"%plesk_bin%\websrvmng.exe" --get-vhost-log-dir --vhostname=enic-naric.net
C:\Inetpub\vhosts\enic-naric.net\statistics\logs\W3SVC32
C:\>cd %plesk_bin%
C:\>cd %plesk_bin%
============
perl awstats.pl -config=enic-naric.net
-DirData=C:\inetpub\vhosts\enic-naric.net\statistics\webstat
-LogFile=C:\inetpub\vhosts\enicnaric.net\statistics\logs\W3SVC32\u_ex1309.log -year=2013
-month=09 -showcorrupted
perl awstats.pl -config=enic-naric.net
-DirData=C:\Inetpub\vhosts\enic-naric.net\statistics\webstat
-LogFile=C:\inetpub\vhosts\enicnaric.net\statistics\logs\W3SVC32\u_ex1309.log -year=2013
-month=09 -update
C:\inetpub\vhosts\enic-naric.net\statistics\webstat\AWStats\cgibin>perl awstats.pl -config=enic-naric.net
-DirData=C:\Inetpub\vhosts\enic-naric.net\statistics\logs\W3SVC32
-LogFile=C:\inetpub\vhosts\enicnaric.net\statistics\logs\W3SVC32\u_ex1309.log -year=2013
-month=09 -update
===PRODUCT/VERSION, OS/ARCHITECTURE===
OS version, architecture:
Window server 2012, 64 bit
Product version (including MU):
Plesk Panel 11.5.30
patch version=17
== PROBLEM DESCRIPTION ==
None
===LOGS AND ANY ADDITIONAL INFORMATION===
Customer does not provide us with migration logs. He told that issue
is reproducible for all migrated domains.
dom_id='55';
| 2013-12-18 |
| 2013-12-19 |
| 2013-12-20 |
| 2013-12-21 |
| 2013-12-22 |
| 2013-12-23 |
| 2013-12-24 |
| 2013-12-25 |
| 2013-12-26 |
| 2013-12-27 |
| 2013-12-28 |
| 2013-12-29 |
| 2013-12-30 |
| 2013-12-31 |
| 2014-01-01 |
| 2014-01-02 |
| 2014-01-03 |
| 2014-01-04 |
| 2014-01-05 |
| 2014-01-06 |
| 2014-01-07 |
| 2014-01-08 |
| 2014-01-09 |
| 2014-01-10 |
| 2014-01-11 |
| 2014-01-12 |
| 2014-01-13 |
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2809796 |
2847486 |
2099211 |
1987369 |
704203 |
2968502 |
512725 |
827150 |
1482386 |
1533429 |
332027 |
3155147 |
1036086 |
576746 |
529582 |
1289097 |
2292992 |
212857 |
2953061 |
1644129 |
1453494 |
2326622 |
2597110 |
1451171 |
384091 |
1657071 |
2313996 |