Answer the question
In order to leave comments, you need to log in
How to correctly configure Fail2Ban for HTTP (DDOS) protection?
The essence of the problem is that an attack occurs periodically on a server with a large number of sites (deliberate, or Google search robots have not yet been able to understand).
When using the SSH command during the attack (the server hangs almost tightly):
netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort-n
iptables -I INPUT -s 185.62.188.91 -j DROP
[apache-ddos]
enabled = true
filter = apache-ddos
action = iptables-multiport[name=ddos, port="http,https"]
sendmail-buffered[name=ddos, lines=5, dest=root]
logpath = / var/www/vhosts/domain.com/statistics/logs/access_log
/var/www/vhosts/wp.domain.com/statistics/logs/access_log
/var/log/apache*/*access.log
bantime=43200
findtime= 600
maxretry = 60
ignoreregex = \.(jpg|jpeg|png|gif|js|css)
Answer the question
In order to leave comments, you need to log in
Limit the number of connections from one ip address. Can be done via iptables.
www.cyberciti.biz/faq/iptables-connection-limits-howto
/sbin/iptables -A INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 5 -j REJECT --reject-with tcp -reset
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question