How To Install mod_evasive on Apache 2.4 in Rocky Linux 9

Published Date Author: , Posted April 15th, 2025 at 9:05:38am

If you’re running Apache 2.4 on Rocky Linux 9 and want to protect your web server against basic DoS, DDoS, or brute-force attacks, installing mod_evasive is a solid option. Unfortunately, the module isn’t included by default, and some manual work is required to get it running. Here’s a quick guide to getting it installed and patched for Apache 2.4.

Step-by-Step Installation

Note: All commands are run as the root user. You may also use sudo in front of each command.

Configure mod_evasive to your needs. You’ll typically add a configuration block like this to your Apache config:

Create the log directory and ensure Apache has permission to write to it:

Download and unpack the source:

For Apache 2.4, the source code needs a small patch to compile cleanly. Let’s handle that next:

Once patched, you can build and install the module using apxs:

This compiles the module, installs it into Apache’s modules directory, and updates your configuration to load it automatically.

Restart the Apache web server:

Reference

More information, including source updates and configuration details, is available on the official GitHub repository: https://github.com/jzdziarski/mod_evasive

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.