Is it possible to automatically block too frequently accessing IP addresses?

newbie asked:

One IP address was accessing my site too frequently to be a real user, it was accessing so much that it caused site to slow down. Is there any application that can automatically block IP, if it is accessing too frequently to my site? My server is Linux Debian.

My answer:

You can use fail2ban to do this. You will probably have to write a custom jail for it, to read your server log and determine how many attempts is too many. Be careful that you don’t ban legitimate users.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.