jueves, 26 de junio de 2014

Prevent DoS/Brute-Force attacks with Apache’s mod_evasive

FUENTE: http://www.rosehosting.com/blog/prevent-dosbrute-force-attacks-by-installing-and-configuring-apaches-mod_evasive-in-gentoo-debian-centos-arch-linux-and-ubuntu/#ubuntu-debian

What is mod_evasive?
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, etc. mod_evasive presently reports abuses via email and syslog facilities.


 UBUNTU / DEBIAN

=> Installation on Debian / Ubuntu

The installation of mod_evasive in a Debian / Ubuntu based VPS is identical. Before we go any steps further with the installation, make sure you have an up-to date system by issuing:
# apt-get update && apt-get upgrade --show-upgraded
Next, install Apache’s module mod_evasive by executing:
# apt-get install libapache2-mod-evasive -y
Once the installation is finished, execute the following commands to configure Apache to use mod_evasive module:
# cat >> /etc/httpd/conf.d/mod_evasive.conf <
DOSHashTableSize 3097
DOSPageCount 5
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 60
DOSEmailNotify your@email.com
DOSLogDir /var/log/apache2/evasive
</IfModule>
EOF
# chown www-data: -R /var/log/apache2/
# /etc/init.d/apache2 restart