IP Banning - the most effective way?

I am launching a large forum, and, like everyone else, there are problems with spammers / bots. There are huge lists of known spam IPs that you can download and use in htaccess form, but my only concern is file size. Therefore, I assume that the question is how large the size is too large, given that it will be downloaded for each user. Adding the entire IP address to it reaches about 100 kb.

Is there an alternative that would have less overhead? Maybe this is done with php, or it will lead to some heavy workload also due to file size and ips check etc.?

Any advice is appreciated.

Thank,

Steve

+3
source share
8

, IP. , javascript cookie .

IP .htaccess. - htaccess . IP- - vhost. , , - .

PHP . , , .

+2

:

  • . , PHP.
  • array_map (ip2long()), , , .
  • IP , , , (Perl Regexp:: Optimizer). PCRE , foreach strpos.  $regex = implode("|", array_map("preg_quote", file("ip.txt")));

IP- . , : . captchas - ( , ).

+1

, , ? ? , SQLite .

0

, , - Captcha?

, - : " , :)

0

, , , 100K.htaccess. , , iptables ip, ( ), , , , .

. , 100% .

0

IP-. , , . IP-, - .

0

In .htaccess in your DocumentRoot, after:

Order Deny,Allow

Add line:

Deny from <black ip>
0
source

Source: https://habr.com/ru/post/1789950/


All Articles