I'm having an ongoing DoS to a certain directory on our Apache web server.
There are a few hundred requests at once, every one to five minutes, always to the same directory, always from the same IP addresses.
As a quick solution, I have removed that directory, making Apache generate a 404 response, and not overload the server.
Otherwise, the server is spiking in CPU, and sometimes dies due to memory issues.
I have both mod evasive and fail2ban installed, but I find them difficult to configure for this.
Is it possible to extract all the IP addresses from
httpd-access.log with
This is how a request looks like:
I need to find a way to set at least two rules e.g status code 404 and target directory "/wheels/cars?size".
There are a lot of examples, but none with two rules.
Thanks,
There are a few hundred requests at once, every one to five minutes, always to the same directory, always from the same IP addresses.
As a quick solution, I have removed that directory, making Apache generate a 404 response, and not overload the server.
Otherwise, the server is spiking in CPU, and sometimes dies due to memory issues.
I have both mod evasive and fail2ban installed, but I find them difficult to configure for this.
Is it possible to extract all the IP addresses from
httpd-access.log with
awk
, cat
or grep
?This is how a request looks like:
Code:
123.123.123.123 - - [11/Oct/2025:07:49:48 +0200] 946 69303 "GET /wheels/cars?size=354%2C357%2C458%2C529%2C543 HTTP/1.1" 404 59341 "-" "Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/3.1)" www.domain.xyz 443
I need to find a way to set at least two rules e.g status code 404 and target directory "/wheels/cars?size".
There are a lot of examples, but none with two rules.
Thanks,