Plesk TTL Reduction
Provided is a means of reducing the Time to Live for Plesk DNS services
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psaThen at the MySQL prompt enter:
INSERT INTO misc VALUES ('SOA_TTL','300');
That will make any new zones created have a TTL of 300. If you then want to re-write all your current DNS zones with the new TTL, you can run this command:
mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e 'select name from domains' | awk '{print "/usr/local/psa/admin/sbin/dnsmng update " $1 }' | sh
This will take a few minutes to complete in most cases. Once complete, your domains will have a TTL of 300
UnCloaked DOS
The following for loop will inject filters against the source IP(s) of the ‘Treason Uncloaked’ attempts to eat up server resources.
for DOS_IP in $(dmesg |grep 'Treason uncloaked!' |cut -d ' ' -f5|cut -d':' -f1 |sort -u); do iptables -A INPUT -s $DOS_IP -j DROP;done
CRON process snapshot
Process information prior to server crash can provide insight into server instability. The following cron can help obtain details necessary to re-instill server stability. This should be used sparingly and in the most dire of circumstances.
*/1 * * * * uptime >> /root/status.txt ; ps -auwwwwx >> /root/status.txt ; free -m >> /root/status.txt */5 * * * * uptime >> /root/status5.txt ; ps -auwwwwx >> /root/status5.txt ; free -m >> /root/status5.txt */10 * * * * uptime >> /root/status10.txt ; ps -auwwwwx >> /root/status10.txt ; free -m >> /root/status10.txt
CRON Log Delivery
This CRON example covers a daily delivery of server logs, in this case mail specific.
5 0 * * * /bin/mail -s "Daily requested mail log" user@domain.ltd < maillog > /dev/null 2>&1