Avoid DoS Attacks using Mod_Evasive on Apache Web Server
Denial of Service, normally called the DDoS attack, is one among the largest threats for your servers security. in a DoS attack, attackers with destructive intentions attempt overloading the server with requests more than the server will handle. The attacker is ready to seek out holes within the security of the server and exploit it to hold out the attack. Please check the subsequent to understand more about DoS Attack .Throughout the initial stages of the attack, the attacker try infecting computing machines with malware or botnets, once a adequate range of machines get infected, a co-ordinated attack is launched automatically over your Web Hosting server, wherein, simultaneous requests are sent to your server. These requests are often within the multiples of thousand.
How to avoid DoS attacks Using mod_evasive ?
mod_evasive are often associate efficient methodology of avoiding a DoS attack. it’s one among the modules available for an Apache HTTP server, that comes at no cost.
How to install mod_evasive over your Linux Hosting server ?
Note: Before proceeding with the installation, it is important that the server is running Apache.
Step i : You are required to login to the server via SSH as root
Step ii : Ensure that the Apache is updated with the latest development files. Use the below command to install http-devel package on your server
yum install httpd-devel
Step iii : Using the following command, you must download the updated version :
wget http://www.zdziarski.com/blog/wp-content/uploads/2010/02/mod_evasive_1.10.1.tar.gz
Step iv : Then use the below command for extracting the archived files:
tar xvzf mod_evasive_1.10.1.tar.gz mod_evasive/
Step v : Then compile the module using the following command :
/usr/sbin/apxs -cia /usr/src/mod_evasive/mod_evasive20.c
Step vi : For activating the module, fire the below command
chmod 755 /usr/lib/httpd/modules/mod_evasive20.so
Step vii : You must then restart Apache
/etc/init.d/httpd restart
Step viii : Ensure that it has been loaded correctly
grep -i evasive /etc/httpd/conf/httpd.conf
The result should be : LoadModule evasive20_module /usr/lib/httpd/modules/mod_evasive20.so
Run : php -r ‘phpinfo();’ | grep -i evasive
The mod_evasive should get listed
Step ix : Now the Apache conf file: /etc/httpd/conf/httpd.conf should be updated with adding configuration rules
<IfModule mod_evasive20.c>
DOSHashTableSize 3097
DOSPageCount 6
DOSSiteCount 100
DOSPageInterval 2
DOSSiteInterval 2
DOSBlockingPeriod 600
</IfModule>
You can also go through the documentation for determining the best configuration settings for each. This should help you avoid a DoS attack on your server.