Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there are a way to automatically block IPs with apache2. For example, if we get a lot requests (100s) for non-existing pages (or known patterns, like CHANGE_LIST.txt, etc.) to block that IP and add it to deny list.

share|improve this question

You could do this using something like fail2ban, which can be made to monitor Apache log files for requests such as you have described and then execute some action when a threshold is reached. That action may modify your local firewall configuration to block the requestor, or perform some other action to cause Apache to reject the requests.

share|improve this answer

Have you tried mod_evasive? It may be exactly what you are looking for, depending on the block time you want.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.