• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Control Panels

How To Enable mod_evasive To Log & Report DOS Attack And BruteForce Attack On Apache

How VPS by How VPS
January 30, 2020
in Control Panels
0
How To Enable mod_evasive To Log & Report DOS Attack And BruteForce Attack On Apache

Apache mod_evasive Positive Negative It works! Apache

0
SHARES
50
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Step 1:
  3. Step 2:
  4. Step 3:
  5. Step 4:
  6. Step 5:
  7. Step 6:
  8. Step 7:
  9. Conclusion:

mod_evasive is a module for Apache that automatically takes action when an HTTP DoS attack or brute force attack is detected. It is used to make logs and alert for issues.

This module creates a list of URLs and IP addresses and the users who fall in the condition set in the configuration, these users will receive a 403 error. In this guide, you will learn how you can enable this feature for CentOS, Ubuntu, Debian.

Prerequisites

  • Apache server
  • Text editor

Step 1:

To install the mod_evasive module you will need the httpd-devel package. It contains the file needed to build Dynamic Shared Objects for Apache. Run the following command to install httpd-devel package.

yum install httpd-devel

Used for CentOS

apt-get install apache2-utils

This command is used for Ubuntu & Debian

Step 2:

Download the mod_evasive module using the wget command in your terminal

cd /usr/src
wget http://www.zdziarski.com/blog/wp-content/uploads/2010/02/mod_evasive_1.10.1.tar.gz

Extract the downloaded module

tarxzfmod_evasive*.tar.gz

Now, go inside the extracted foler.

cd mod_evasive

Step 3:

Now you need to install a tool called apxs2. It is used along with Apache for building and installing added functionality.

apxs2-ciamod_evasive20.c

This command will not run if httpd-devel is not installed properly.

Step 4:

Download and install the epel repository to move ahead.

yum install epel-release

After the installation of the epel repository, install mod_evasive using

yum install mod_evasive

Step 5:

You can now verify if the module has been added to the Apache functionality or not. Open your configuration file to check if the module has been added or not.

The configuration file is located at a different location for a different operating system.

For Ubuntu/Debian,

/etc/apache2/apache2.conf

For CentOS,

/etc/httpd/conf/httpd.conf

In Ubuntu, add the following line at the end of the config file

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

For CentOS, Search for Include and look for

Include mods-enabled/*.conf

Add the above lines for each Operating system if they are not available in the config file.

Step 6:

To set the rule for DOS count and DOS interval and other settings, add the following code to the same config file from Step 5.

<IfModulemod_evasive20.c>
    DOSHashTableSize 4012
    DOSPageCount 3
    DOSSiteCount 50
    DOSPageInterval 1
    DOSSiteInterval 1
    DOSBlockingPeriod 70
    DOSEmailNotify <[email protected]>
</IfModule>

This config will send an alert to the mentioned email address if the DOS attack meets the above set configuration.

Step 7:

Once the configuration has been set, you can now restart the Apache web server for the changes to be reflected.

service httpd restart

Also, make sure the module is loaded into Apache in the next reboot by using the following command.

httpd -M | grep evasive

How To Enable mod_evasive To Log & Report DOS Attack And BruteForce Attack On Apache

Conclusion:

That’s it. You have now successfully installed the mod_evasive module in Apache and your app is safer now.

Tags: HTTP DoS attack
Previous Post

How to install Zabbix on Ubuntu 18.04 [PART TWO]

Next Post

How To Change The Apache Web Root To Another Directory on an Ubuntu 18.04 VPS or Dedicated Server

Next Post
How To Change The Apache Web Root To Another Directory on an Ubuntu 18.04 VPS or Dedicated Server

How To Change The Apache Web Root To Another Directory on an Ubuntu 18.04 VPS or Dedicated Server

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet