简体   繁体   中英

Block IP if too many requests come per second on Apache2

How can I block an IP / the requests of an IP if too many requests come per second?

Sometimes I notice many (about 50) webpage requests per second to my webserver. I think a script copies the content of the server. Now I want to block the IP if they make to many requests. They can delete the block, if they enter a captcha. Google does something like this (Just make a fast webcrawler and crawl Google. You'll be blocked quite soon. Don't do this in school ;-) )

I use PHP-Scripts on an Apache2 server. I can't install new software on this server, but I can use htaccess files. I hope it is possible to solve this problem with this limited possibilities.

I'd start looking at the DOS-protection modules. This might be a higher load than you were envisaging - I'm unclear if you're talking about 10s of requests per minute or hundreds per second...

You should have a look at this module and see if it fits your needs.

如果你可以安装模块:这可以帮助你: http//httpd.apache.org/docs/2.2/howto/access.html

The best way to block ip based on requests should be done on the firewall.. We can even configure firewall for certain no. of false authentication trials..

But if you want to do this only through apache then the module referred by Basiclife would be good..

But always make sure that you dont restrict the real visitors who use your server more.. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM