Apache-Zugriffe begrenzen

06 February 2025 - 21:43 | Version 1 |

Worum geht es?

mod_evasive

Das Modul mod_evasive ist speziell für den Schutz gegen DoS-Angriffe gedacht und kann Anfragen pro Sekunde begrenzen.

  1. Installieren: sudo apt install libapache2-mod-evasive
  2. Bearbeite die Konfigurationsdatei /etc/apache2/mods-available/evasive.conf

<IfModule mod_evasive20.c>
    DOSHashTableSize    3097
    DOSPageCount        2        # Max. Anfragen pro Sekunde pro Seite
    DOSSiteCount        50       # Max. Anfragen pro Sekunde pro IP
    DOSPageInterval     1.0
    DOSSiteInterval     1.0
    DOSBlockingPeriod   10       # IP wird für 10 Sekunden gesperrt
    DOSLogDir           "/var/log/mod_evasive"
</IfModule>

  1. Erstelle das Log-Verzeichnis:
    sudo mkdir -p /var/log/mod_evasive sudo chown www-data:www-data /var/log/mod_evasive
  2. Aktiviere das Modul und starte Apache neu:
    a2enmod evasive
    systemctl restart apache2
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding wiki.doebe.li? Send feedback
This page was cached on 29 May 2025 - 16:34.