M
M
mynewvk2014-04-05 10:49:06
CodeIgniter
mynewvk, 2014-04-05 10:49:06

How to block and check banned ip? PHP?

i need it to be banned when ip makes too many requests per second. How to check ip in Codeigniter so as not to write a check in each controller? also tell me how to check how many ip makes requests per second?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Y
Yuri Gorin, 2014-04-05
@mynewvk

Agree with other commentators. Protection must be implemented not in php, but by means of the server. However, if you are completely impatient, then you can do something a la vitalykim.ru/zashhita-ot-ddos-atak-na-php.html
And implement a call to check for ddos ​​in the MY_Controller constructor and inherit all controllers from it, or implement hook pre_controller .

E
Eugene, 2014-04-05
@Nc_Soft

nginx limit_req
at the php level is useless, because the php script is already running, but you just need to protect yourself from its frequent launch.

V
vasilushechka, 2014-04-05
@vasilushechka

Another option: you can use fail2ban for iptables.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question