How can I block an IP, if I'm getting many http requests in a second in php

598 Views Asked by At

Making a function that ensure a user is not sending a bulk request and if so then it should be blocked for sometime.

1

There are 1 best solutions below

0
On

It's better to do it on the web server and/or OS level. A simple solution to try is mod_evasive for Apache.

mod_evasive is an evasive maneuvers module for Apache to provide evasive action in the event of an HTTP DoS or DDoS attack or brute force attack. It is also designed to be a detection tool, and can be easily configured to talk to ipchains, firewalls, routers, and etcetera.

You can do the same with mod_security but it's way more complicated.