Manage Apache Download Speed And Traffic Limits With mod_cband - Page 3
3.2 Configure Traffic LimitsIn the next example we want to give our vhost www.example.com a traffic limit of 100MB per month, and if that limit is exceeded, we want to limit the download speed to 128kbps, max. 5 requests per second and max. 15 open connections:
The directives are pretty self-explanatory. The CBandPeriod directive specifies after what time the traffic counter is reset to 0. The next example is pretty similar, but now we don't want the speed to be limited if the traffic is exceeded, no, we get more restrictive and deliver a 503 status page instead:
If you want to redirect the user to a URL instead of presenting a 503 error to him, you can do it like this:
Please note: the CBandExceededSpeed and the CBandExceededURL directives are mutually exclusive. They do not make sense in the same vhost! After your changes, you must restart Apache: Debian: /etc/init.d/apache2 restart Fedora: /etc/init.d/httpd restart Of course, you are free to combine the directives of chapter 3.1 and 3.2 in any way you like.
4 Status PageTo view the current bandwidth limits, usages, users, scoreboards, add the following Location lines to the vhost configuration:
Restart Apache, and afterwards you can find the status pages under http://www.example.com/cband-status and http://www.example.com/cband-status-me:
5 Links
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com






print: 
Recent comments
20 hours 41 min ago
22 hours 10 min ago
1 day 1 hour ago
1 day 4 hours ago
1 day 7 hours ago
1 day 8 hours ago
1 day 8 hours ago
1 day 9 hours ago
1 day 10 hours ago
1 day 11 hours ago