HowTo Restricting traffic to a virtual host in apache
|The following configuration will limit the speed for the virtual host to 1024kbps, with the ability to serve not more than 10 requests per second and a maximum of 30 open connections. Each visitor can establish max three simultaneous connections and receive data at speeds no higher than 20kb/s. In addition, a virtual host can spend no more than 100 MB of traffic during 4 weeks, if the limit is exceeded the speed will be limited to 128kbps.
ServerName www.test.com
ServerAdmin [email protected]
DocumentRoot /var/www
CBandLimit 100M
CBandExceededSpeed 128 5 15
CBandSpeed 1024 10 30
CBandRemoteSpeed 20kb/s 3 3
CBandScoreboard /var/www/scoreboard
CBandPeriod 4W