Wednesday, June 18, 2008

Installation of Mod_Evasive

Mod_Evasive is an apache module which helps protecting against people sending too many requests to the web server in an attempt to flood it. If it detects too many connections the offending ip will be blocked from the accessing apache for this is especially useful when the server is continuously getting attacked.

Following are the steps to install and configure it on a Linux Machine:

Login to the server as root and execute

cd /usr/local/src
wget http://www.zdziarski.com/projects/mod_evasive/mod_evasive_1.10.1.tar.gz
tar -zxvf mod_evasive_1.10.1.tar.gz
cd mod_evasive

For apache 2.0.x
/usr/sbin/apxs -cia mod_evasive20.c

Then add add this too httpd.conf

DOSHashTableSize 3097
DOSPageCount 6
DOSSiteCount 100
DOSPageInterval 2
DOSSiteInterval 2
DOSBlockingPeriod 600


For apache 1.3.x
/usr/local/apache/bin/apxs -cia mod_evasive.c

Then add this too httpd.conf

DOSHashTableSize 3097
DOSPageCount 6
DOSSiteCount 100
DOSPageInterval 2
DOSSiteInterval 2
DOSBlockingPeriod 600

Now just restart apache and the installation is complete.

/etc/init.d/httpd restart

0 comments: