Unix Plesk Solutions
Parallels Plesk Panel Fixes
The information below is for a Linux based Parallels Plesk Panel installation.
FreeBSD and others might use other paths and utilities to do the same thing.
I hold in no way any guarantee or responsibility that this wont erase all data on your and your friends computers.. but it does work for me!
A Few Tricks
Change Overuse settings
In Plesk they use Overuse setting as a mean to restrict a client or domain to only use the allowed limits. This can be changed to ether
- Block, where it blocks the client/domain when the limit is reached
- Notify, where the client/domain owner gets a notification email when the limit is reached
- Normal, where the client/domain can exceed the limits without notifications other then that in the interface
How to change
I found and modified a few scripts on the web to work in my own benefit.. this is how :)
Change Overuse to "Normal" on all Clients in the system
First figure out which have overuse on the client and what the value is now
#!/bin/bash -
USER="admin"
PASS='cat /etc/psa/.psa.shadow'
for i in 'mysql -u $USER -p$PASS --skip-pager --skip-column-names --batch psa -e 'SELECT login FROM clients WHERE perm_id IS NOT NULL;'' ; do
echo -n "$i -- "
/opt/psa/bin/client_pref --info $i | grep Overuse | awk '{print $3}'
done
Now we want to change all that has "notify" as current policy to "normal" thus skipping the notification email
#!/bin/bash -
USER="admin"
PASS='cat /etc/psa/.psa.shadow'
for i in 'mysql -u $USER -p$PASS --skip-pager --skip-column-names --batch psa -e 'SELECT login FROM clients WHERE perm_id IS NOT NULL;'' ; do
CURRSTAT='/opt/psa/bin/client_pref --info $i | grep Overuse | awk '{print $3}''
if [ "$CURRSTAT" == notify ] ; then
/opt/psa/bin/client_pref --update $i -overuse normal
fi
done
Change Overuse to "Normal" on all Domains in the system
This can be done in one long command, because I figured out where the domain names where stored ;P
First list current values
#!/bin/bash -
USER="admin"
PASS='cat /etc/psa/.psa.shadow'
for i in 'mysql -u $USER -p$PASS --skip-pager --skip-column-names --batch psa -e 'select name from domains;''; do
echo -n "$i -- "
/opt/psa/bin/domain_pref --info $i | grep Overuse | awk '{print $3}'
done
Then change all to "normal"
#!/bin/bash -
USER="admin"
PASS='cat /etc/psa/.psa.shadow'
for i in 'mysql -u $USER -p$PASS --skip-pager --skip-column-names --batch psa -e 'SELECT name FROM domains;'' ; do
CURRSTAT='/opt/psa/bin/domain_pref --info $i | grep Overuse | awk '{print $3}''
if [ "$CURRSTAT" == notify ] ; then
/opt/psa/bin/domain_pref --update $i -overuse normal
else
echo "$i is already $CURRSTAT"
fi
done
Change Webstats settings
In the newer Plesk versions you can choose between AWStats and Webstats as a web statistics engine. We prefer AWStats .. and we used to have AWStats externally. As we upgraded to the last known release we were able to move to the more current and supported version. This is how we changed the webstats setting from None to AWStats with password protection.
How to change
I found and modified a few scripts on the web to work in my own benefit.. this is how :)
Change Webstats to AWStats and also set password protection on the sites
#!/bin/bash -
USER="admin"
PASS='cat /etc/psa/.psa.shadow'
for i in 'mysql -u $USER -p$PASS --skip-pager --skip-column-names --batch psa -e 'SELECT name FROM domains;''; do
INFO='/opt/psa/bin/domain --info $i | grep "Web statistics" | awk '{print $3}''
if [ "$INFO" == "None" ]; then
echo "$i -- $INFO"
/opt/psa/bin/domain --update $i -webstat awstats -webstat-protdir-access true
fi
done