Linux

Limit Bandwidth in Apache2

May 10, 2012 Rich 1 min read

Limit bandwidth with Apache using the libapache2-mod-bw package which installs mod-bw.
Install Package

apt-get install libapache2-mod-bw

Load Module

a2enmod bw

Modify Apache’s configuration
Add the following in the VirtualHost section… in Debian, the Virtual Host configuration files are typically found inin /etc/apache2/sites-available/.

BandwidthModule On
ForceBandwidthModule On
# 1mbit/s (128KB/s) - value is in bytes
Bandwidth all 131072
ErrorDocument 510 510.html
BandWidthError 510

Reload Apache

service apache2 reload

Leave a comment