I set up mod_evasive
on Apache/2.4.18
using this guide: https://komunity.komand.com/learn/article/server-administration/how-to-configure-modevasive-with-apache-on-ubuntu-linux/
I only changed email@yourdomain.com
to root@localhost
.
The first time I used test.pl
it worked, but every remaining time it only shows HTTP/1.1 400 Bad Request
. I'm not sure if I accidentally changed anything, but here's my test.pl
.
#!/usr/bin/perl
# test.pl: small script to test mod_dosevasive's effectiveness
use IO::Socket;
use strict;
for(0..100) {
my($response);
my($SOCKET) = new IO::Socket::INET( Proto => "tcp",
PeerAddr=> "127.0.0.1:80");
if (! defined $SOCKET) { die $!; }
print $SOCKET "GET /?$_ HTTP/1.0\n\n";
$response = <$SOCKET>;
print $response;
close($SOCKET);
}
Because it worked the first time, shouldn't there be a log of it? I checked /var/log/mod_evasive/
and it's empty. In syslog
there is also no mention of mod_evasive
. There is only root
in /var/mail/
which hasn't received a mail of mod_evasive
either.
Could it be because I'm redirecting http
to https
? I setup a Redirect permanent / https://mydomain.example
in 000-default.conf
.