Deleting Stats logs daily in cPanel
Deleting Stats logs is something that is enabled on most servers but one does encounter servers with a full domlogs directory. To delete those logs you can follow these steps.
First step is to check how large are the apache domain logs, you can check those on a cPanel server by running “du -hs /usr/local/apache/domlogs”. If the size of those logs is large, then you may want as much free space as possible. Login to WHM and click Tweak Settings. Within that menu click “Delete each domain’s access logs after stats run” which will enable this and click ‘Save’. Now at the end of the stats run every night it will wipe out the directory so you should not have the logs grow very large, unless of course your server is very busy.
Unable login into the domain stats
Issue: Unable to login into the stats of the domain (in Plesk). It is asking the password continuously.
Search for the following entry in /var/www/vhosts/domainName/conf/httpd.include:
(The file /var/www/vhosts/domainName/conf/httpd.include is actually HTTPD_VHOSTS_D/domainName/conf/httpd.include):
<Directory "/var/www/vhosts/domainName/statistics">
AuthType Basic
AuthName "Domain statistics"
AuthUserFile /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat
require valid-user
</Directory>
It is in that AuthUserFile, the login name as well as the encrypted password is stored.
So adding a new user login details in that file fix the problem, and you can add it as follows.
Create the encrypted password using htpasswd command.
htpasswd -bd /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat
This will fix the issue.
Note : Replace the domainName by corresponding domain name.
How to disable the the stats services(Analog or Awstats or Webalizer stats)
You can disable Analog or Awstats or Webalizer stats in a cpanel server via backend by editing the file “/var/cpanel/cpanel.config”.
Check for the variables skipanalog, skipawstats, skipwebalizer in the file and change the values of the variables to one. Now the variables should look like as follows:
skipanalog=1
skipawstats=1
skipwebalizer=1
Save the changes and restart the cpanel service in the server.
/etc/init.d/cpanel restart
Now the all the three stats will be disabled server wide.