We have Ubuntu 14.04 Apache servers that host thousands of websites in a shared hosting environment, and occasionally one or another websites get the attention of DDOS attackers.
Question:
What is the best apache module or method for detecting and banning IP addresses that are too active?
Requirements:
Fail2ban can help with that, you will need to configure it to fit your Requirements
Fail2ban scans log files (e.g. /var/log/apache/error_log) and bans IPs that show the malicious signs -- too many password failures, seeking for exploits, etc. Generally Fail2Ban is then used to update firewall rules to reject the IP addresses for a specified amount of time, although any arbitrary other action (e.g. sending an email) could also be configured. Out of the box Fail2Ban comes with filters for various services (apache, courier, ssh, etc).