Plesk

High CPU usage by Apache is shown in Health Monitor

Symptoms

Cause

Denial of service (DoS) attack.

Resolution

Currently, there is no available DDOS protection in Plesk by default, so to be able to block IPs it is necessary to block them manually. Ban IP address that is trying to access site with the Firewall. Use the article below to manage Firewall rules:
How to manage ports and firewall rules on Plesk for Linux server

The following commands may be used to make sure firewall was adjusted correctly and DoSing has stopped:

  1. Connect to the server via SSH;

  2. Sort out all access logs, to include in the document processed and current logs only:

    # find /var/www/vhosts/system/ -name access_* ! -name '.gz' ! -name '.webstat' -exec cat {} >> /root/ddos.log ;

  3. Sort out records for the exact period only:

    # grep -E "02/Oct/2017:0[4-8]" ddos.log >> new_ddos.log

  4. Sort IP addresses, that were mentioned in ddos.log with the number of times addressed (this will show the list of IP addresses from the least amount of times to the largest):

    # cat new_ddos.log | awk ' {print $1} ' | sort -n | uniq -c | sort -n

Exit mobile version