Dapper under the apache2 bandwidth flow limit, first confirm the installation of good apache2, installation Libapache2-mod-cband
Apt Install Libapache2-mod-cband
Activate Cband module
Cd/etc/apache2/mods-enabled
Ln-s/etc/apache2/mods-available/cband.conf cband.conf
Ln-s/etc/apache2/mods-available/cband.load Cband.load
Upgrade Libapache2-mod-cband
Apt Install Apache2-prefork-dev
Cd/tmp
wget 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
Because the Cband module is already loaded by Cband.load, the/etc/apache2/httpd.conf is modified to remove the row that joins Cband_module.
Vim/etc/apache2/httpd.conf
Find
LoadModule cband_module/usr/lib/apache2/modules/mod_cband.so
deleted, and saved. To set up a site:
<virtualhost 1.2.3.4>
ServerName www.example.com
ServerAdmin webmaster@example.com
Documentroot/var/www
Cbandspeed 1024 10 30
Cbandremotespeed 20kb/s 3 3
</VirtualHost>
Cbandspeed limits the total access speed of www.example.com virtual hosts to 1024kbps, maximum 10 requests per second and 30 connections per second. Cbandremotespeed limit the access speed of any individual www.example.com virtual host to 20KB per second, maximum 3 requests per second and 3 connections per second.
Restart Apahe2 to make it configured for:
/etc/init.d/apache2 restart
You can also use the URL:
Http://www.example.com/cband-status
Http://www.example.com/cband-status-me
To see the latest traffic.