Hello everyone,
I know this might be a simple question and may have been asked multiple times, but I couldn’t find a clear answer.
I'm frequently receiving the following email alert from Plesk:
After connecting via SSH and running the following command:
ss -tan state established | grep ":80\|:443" | awk '{print $4}'| cut -d':' -f1 | sort -n | uniq -c | sort -nr
I notice that one IP always has a significantly high number of connections (e.g., 184 connections from xx.xx.xx.xx).
This looks like a DDoS attack, and my current solution is to manually ban the IP using Fail2Ban, which immediately restores normal performance. However, I want to automate or prevent this before it affects my server performance.
Thanks in advance!
I know this might be a simple question and may have been asked multiple times, but I couldn’t find a clear answer.
I'm frequently receiving the following email alert from Plesk:
When this happens, all websites on the server start running extremely slow.We have detected a critical status for one of the server parameters.
Please log in to Plesk and check the server status.
The message from Monitoring:
The memory usage status is critical!
The current value is 3.4 GiB.
After connecting via SSH and running the following command:
ss -tan state established | grep ":80\|:443" | awk '{print $4}'| cut -d':' -f1 | sort -n | uniq -c | sort -nr
I notice that one IP always has a significantly high number of connections (e.g., 184 connections from xx.xx.xx.xx).
This looks like a DDoS attack, and my current solution is to manually ban the IP using Fail2Ban, which immediately restores normal performance. However, I want to automate or prevent this before it affects my server performance.
My questions:
- Is there a way to automatically block an IP that exceeds a certain number of connections in Plesk or Fail2Ban?
- Any other best practices to prevent these types of issues?
Thanks in advance!