Installation of mod_evasive on cPanel/WHM

This article is about installing of apache’s mod_evasive on cpanel/whm, to help against DOS and DDOS attack.

Get the latest source of mod_evasive
$ wget
$ tar zxvf mod_evasive_1.10.1.tar.gz
$ cd mod_evasive

Load mod_evasive into apache
$ /usr/local/apache/bin/apxs -i -a -c mod_evasive20.c

Next, distill the module to apache
$ /usr/local/cpanel/bin/apache_conf_distiller –update

Last, edit apache config file
$ vim /usr/local/apache/conf/httpd.conf

and Add this directive

<IfModule mod_evasive20.c>
DOSHashTableSize 3097
DOSPageCount 2
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 3600
DOSEmailNotify admin@domain.tld
DOSSystemCommand “sudo /sbin/iptables -A INPUT -s %s -j DROP”
DOSLogDir “/var/log/evasive/”


Author: Ali MEZGANI

My name is MEZGANI Ali. I was born back in 1978 in Rabat Morocco. My interests are Debian Linux , programming , science and music.

One thought on “Installation of mod_evasive on cPanel/WHM”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s