Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

If you are running Plesk 11 and you have root access to the box, what are the ways I can use to turn off AW Stats on all accounts and delete the web statistics data?

My plesk box crashes every day during the calculation of the statistics.

I am using Plesk 11 on Ubuntu 12.10 64bit hosted on Amazon AWS.

share|improve this question
add comment

1 Answer

No more AWStats!

Assuming that you are using the default plesk 11 setup on linux/ubuntu, with /var/www/vhosts as your main directory for all your virtual hosts, you can use the following bash script:

#!/bin/bash
for i in /var/www/vhosts/*; do
        echo "Turning off and deleting Stats for"
        echo `basename $i`
        /usr/local/psa/admin/bin/webstatmng --unset-configs --stat-prog=awstats --domain-name=`basename $i`
        /usr/local/psa/admin/bin/webstatmng --clean --stat-prog=awstats --domain-name=`basename $i`
done

But How?

To run this, follow the following steps:

  1. SSH into your server using putty or terminal, using a user that has sudo access
  2. run sudo bash to get root level privileges
  3. cd /var/www/vhosts
  4. nano TurnOffStats
  5. Paste in the code above
  6. Save the file and exit (ctrl+x)
  7. `chmod +x TurnOffStats
  8. ./TurnOffStats

You should see each domain listed and a message explaining it is turning off stats. Good luck!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.