Would you like to learn how to install Mod_evasive on the Apache server? In this tutorial, we are going to show you how to install the Apache server and configure the Mod_evasive.

• Ubuntu 20
• Ubuntu 19
• Ubuntu 18
• Apache 2.4.41

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Tutorial Apache - Mod_evasive installation

Install the Apache server.

Copy to Clipboard

Install the Mod_evasive package.

Copy to Clipboard

The system will install an email service named Postfix.

Do not configure the email service.

Apache - Mod_evasive installation

Disable the Postfix service.

Copy to Clipboard

Edit the Mod_evasive configuration file.

Copy to Clipboard

Here is the file, before our configuration.

Copy to Clipboard

Here is the file, after our configuration.

Copy to Clipboard

Change the values on the configuration file to fit your needs.

Create a directory to store the logs.

Copy to Clipboard

Create an exception file.

Copy to Clipboard

Here is the file content.

Copy to Clipboard

IP addresses included in this file will not be blocked.

Configure the correct permission.

Copy to Clipboard

Restart the Apache service.

Copy to Clipboard

The DOSHASHTABLESIZE option specifies the size of the hash table that stores IP addresses.

The DOSPAGECOUNT option specifies the limit for the number of requests for the same page.

The DOSSITECOUNT option specifies the limit for the total number of requests for any object by the same client on the same site during the configured interval.

The DOSPAGEINTERVAL option specifies the interval for the page count threshold.

The DOSSITEINTERVAL option specifies the interval for the site count threshold.

The DOSBLOCKINGPERIOD option specifies the number of seconds that an IP will be blocked.

Congratulations! You successfully installed the Mod_evasive on the Apache server.