Search

How to Mitigate a DDoS Attack with Apache

0 views

Mitigating a DDoS (Distributed Denial of Service) attack on DDoS Mitigation With Apache

Configure rate limiting

To configure rate limiting for DDoS attacks with Apache, you can use the mod_evasive module. This module helps protect your server from DDoS attacks by limiting the number of requests from a single IP address within a specified time period. Here's how you can set it up:

Check if mod_evasive is installed: Run the following command to see if the module is already installed on your Apache server:perl

Prompt
apache2ctl -M | grep evasive
Install mod_evasive: If the module is not installed, you need to install it. The installation process might vary depending on your operating system. For example, on Ubuntu, you can use the following command:

Prompt
sudo apt-get install libapache2-mod-evasive
Configure mod_evasive: Open the mod_evasive configuration file using a text editor. On Ubuntu, the file is located at /etc/apache2/mods-available/evasive.conf

Here's an example configuration to get you started:

Prompt
<IfModule mod_evasive24.c> DOSHashTableSize 3097 DOSPageCount 5 DOSSiteCount 50 DOSPageInterval 1 DOSSiteInterval 1 DOSBlockingPeriod 10 DOSLogDir "/var/log/apache2/evasive/" DOSEmailNotify "admin@example.com" DOSWhitelist 127.0.0.1 DOSWhitelist 192.168.0.* </IfModule>

Explanation of the configuration options:

Configure mod_evasive by adding the following directives to your Apache configuration file:

Share this article

Comments (0)

Please sign in to leave a comment.

No comments yet. Be the first to comment!