Every website as long as becoming popular needs a proper DoS or DDoS protection. There is a plenty of solutions out there but mod_evasive offers something that others don’t – ability to manage upstream firewalls and block traffic directly there as well as serving a Forbidden page.
What is mod_evasive?
According to the official website
mod_evasive is an evasive maneuvers module for Apache to provide evasive action in the event of an HTTP DoS or DDoS attack or brute force attack. It is also designed to be a detection and network management tool, and can be easily configured to talk to ipchains, firewalls, routers, and etcetera. mod_evasive presently reports abuses via email and syslog facilities.
Installation on Debian or Ubuntu
apt-get install libapache2-mod-evasive
Enable mod_evasive on Debian or Ubuntu
By default mod_evasive comes without a default configuration. One can use the following example: