mod_evasive prevent DOS attacks on apache webserver

aptitude search mod-evasive
p libapache2-mod-evasive – evasive module to minimize HTTP DoS or brute force attacks

aptitude install libapache2-mod-evasive

mkdir -p /var/log/apache2/evasive

chown -R www-data:root /var/log/apache2/evasive/

vim /etc/apache2/mods-available/mod-evasive.load

LoadModule evasive20_module /usr/lib/apache2/modules/mod_evasive20.so

DOSHashTableSize 3097
DOSPageCount 5
DOSSiteCount 100
DOSPageInterval 2
DOSSiteInterval 2
DOSBlockingPeriod 600
DOSLogDir “/var/log/apache2/evasive”
DOSEmailNotify user@domain.com

apachectl configtest
Syntax OK

apachectl restart