Seemingly random 403 errors on Apache

At some point I realized that apache was giving seemingly random “403 Forbidden” errors. This when under high load and yet, not really high at all. I would be able to trigger it by reloading some page a few times quickly in a row or loading a page with a lot of images.

The problem was mod_evasive, a module designed to protect against DOS attacks. The above usage pattern was being categorised as an attack and rejected. This page explains the details and this page explains how to deal with it in Ubuntu.

I did have to loosen up some settings, namely:

  • DOSPageCount 10 (the number of pageviews allowed within DOSPageInterval secs)
  • DOSSiteCount 10000 (the number of object requests allowed within DOSSiteInterval secs, that is images, stylesheets, javascrip files ...)

Tags: , , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s