To install type:
sudo apt-get install libapache2-mod-cband
Then add the following to your apache2.conf file:
LoadModule cband_module /usr/lib/apache2/modules/mod_cband.so
On Fedora there is modules folder link in the /etc/httpd configuration folder.
This blog post details configuring a virtualhost with cband throttling:
http://www.bgevolution.com/blog/index.php/apache-mod-cband/
Share, Enjoy, and Support:
In the apache configuration file you can create, from my experience, practically as many VirtualHosts as you’d like. These VirtualHosts can be for the actual domain, or of a subdomain, and can be configured as shown in my previous post:
http://www.bgevolution.com/blog/index.php/apache-mod-cband/
Utilizing Cband, in such a fashion, can limit/throttle the bandwidth of only subdomain, the entire domain, or any combination thereof. This versatility allows for the custom tailoring of you available bandwidth.
Share, Enjoy, and Support:
The Cband Apache module can be downloded from the official website here:
http://cband.linux.pl/
This module provides full bandwith limiting of all Apache VirtualHosts. First reference the newly added module with:
LoadModule cband_module      /etc/apache2/mod_cband.so
You can put the module anywhere you want, just adjust the directory location accordingly. Now you can add a VirtualHost as usually, and add the addition cband configuration parameters to establish desired functionality.
<VirtualHost *>
ServerName www.bgevolution.com
ServerAdmin admin@bgevolution.com
DocumentRoot /home/user/bgevolution/
CBandSpeed 5000kb/s 24 16
CBandRemoteSpeed 2500 12 8
</VirtualHost>
The CbandSpeed parameter established a maximum bandwidth limit on the entire VirtualHost. The 24 refers to the maximum requests per second, and the 16 refers to the maximum sustained connections at any one time. The CbandRemoteSpeed parameter establish bandwidth throttling for any one specific website visitor. With this parameter you can limit each visitor specifically. Play around with the numbers, try and download something, and you will see in real time the effect your configuration has on the actual download speed.
Share, Enjoy, and Support:
The CBand Apache module allows for the limiting/throttling of the bandwidth to and from a a hosted website. It can be configured within a virtualhost to allow varying parameters from one website to another. Can a separate virtualhost be created for a particular root file location, and then a subfolder within the same location? My circumstance is the large files associated with the Alternative Energy Repository that is part of this domain. Theoretically by having a separate virtual host for each the main website, and the large files, the bandwidth limiting can be concentrated on the large files, while allowing full speed for the relatively small html, and php files.
Share, Enjoy, and Support:
CBand allows for bandwidth control of Apache virtual hosts. To install make sure you have:
apt-get install apache2-prefork-dev
Then:
cd /tmp
wget http://cband.linux.pl/download/mod-cband-0.9.7.4.tgz
tar xzvf mod-cband-0.9.7.4.tgz
cd mod-cband-0.9.7.4
./configure
make
make install
The tar automatically installs your module in the httpd modules folder, and the following command will add its location to the httpd.conf file:
vi /etc/apache2/httpd.conf
If your on Fedora Core 6 simply restart the Apache server: “service httpd restart”, or you can always do “/etc/init.d/apache2 restart”.
Share, Enjoy, and Support:
Because home networks tend to be limited on their upload speeds, it is recommended to limit website visitors to a maximum of 3 connections per section, and 1 sustained connection. The amount of connections per section may have to be optimized depending on the quantity of content on any particular website. For instance this website, using 3 connections per section, allows for all images to be loaded without overloading the bandwidth limiting configuration. Currently this website is limited to 3 sustained connection (ie. downloads) at a time to allow for up to 10 website visitors. For instance if 10 people are online, each downloading a single file @ 6kbps, the total upload speed with obviously be 60kbps. On most standard home network this is reaching toward the upper limit of available upload bandwidth. This is obviously a serious issue because 6kbps is extremely slow, and will remind website visitors of their old days with 56k dial-up modems. Considering this, as web site traffic inevitably will increase, it is worthwhile to either consider paying a hosting charge with a mainstream company like Yahoo or Godaddy, or consider upgrading you home based internet to a commercial level with an increase bandwidth allotment.
Share, Enjoy, and Support:
A quick link to a perfect tutorial.
http://howtoforge.com/mod_cband_apache2_bandwidth_quota_throttling
Share, Enjoy, and Support: