Hi there. If your server is managed tell the person who manages it to setup mod_evasive or mod_cband or whatever alternative they prefer to limit requests per ip per second or whatever and they should take it from there.Hi!
I can crash my forums by holding down F5. I've disabled all add-ons, enabled APC and reduced PHP memory limit down to 8M. I'm on a managed server so I can't install any Apache mods, what should I do?
Hi there. If your server is managed tell the person who manages it to setup mod_evasive or mod_cband or whatever alternative they prefer to limit requests per ip per second or whatever and they should take it from there.
Unfortunately there is not much you can other than find a different host within the same budget who can keep your site up and stop that sort of thing. However...if you already have your ip address or range set in a white-listed type of configuration and send a ridiculous amount of requests from that ip address you could still take down your own server if it is smaller server.Sadly, this is not an option as they won't install any additional mods.
private $url = 'foobar';
private $urlCount = 0;
function checkUrlCount() {
if ($this->url == $_SERVER['REQUEST_URI']) {
$Now = C_Timestamp::now();
if ($this->UrlTime->addSeconds(2)->isLessThan($Now)) {
$this->urlCount = 0;
$this->UrlTime = $Now;
}
$this->urlCount++;
} else {
$this->UrlTime = C_Timestamp::now();
$this->url = $_SERVER['REQUEST_URI'];
$this->urlCount = 1;
}
if ($this->urlCount > 4) {
$this->UrlTime = C_Timestamp::now();
echo $this->urlCount . ' refreshes in last 2 sconds. ';
echo 'Too many refreshes. ';
echo '<p>Wait for a few seconds and click here: <a href="' . $this->url . '">' . $this->url . '</p>';
exit;
}
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.