Reputation: 7299
I installed mod_evasive as per instructions in https://www.atlantic.net/vps-hosting/how-to-install-and-configure-modevasive-with-apache-on-ubuntu-18-04/ but with configuration like below:
DOSHashTableSize 3097
DOSPageCount 1
DOSSiteCount 10
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 10
But when I run the perl script I don't see the IP being blacklisted with all requests getting response 200 ok, when I am expecting 403 Forbidden :(
What am I getting wrong??
Additional details: When I re-start my Apache, I see 6 instances of it. And when I run the test perl script, check for the number of apache instances immediately I see the count at 30-ish instances before it comes down to 10 after a while.
My Apache config looks like below:
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
My mpm_prefork_module config looks like below:
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 80
MaxConnectionsPerChild 1
Is this an issue with Apache configuration??
Upvotes: 0
Views: 963
Reputation: 7299
The issue was not with mod_evasive
or its configuration per se.
In my case I had to tweak the configuration of mpm_prefork_module
like below to get mod_evasive configuration to work:
StartServers 10
MinSpareServers 10
MaxSpareServers 10
MaxRequestWorkers 80
MaxConnectionsPerChild 0
Basically fix the number of servers to constant by setting StartServers = MinSpareServers = MaxSpareServers = {your_magic_number}
and set MaxConnectionsPerChild=0
, so that no new server processes are spawned and no re-cycling of connections happen, allowing Child to hold infinitely many concurrent connections.
I lost a day in fixing this one and hope with this answer having the formulae, you don't lose your day :)
Upvotes: 0