charliecreed
Verified User
- Joined
- Feb 26, 2006
- Messages
- 56
Tested on Debian
You can use mod_bw on apache2 to limit the speed of which files get uploaded.
That's mod_bw installed, now you just have to configure the virtual templates.
Examples:
Once configured virtual hosts you will have to restart httpd:
Redhat/Fedora: service httpd restart
Debian: /etc/init.d/httpd restart
Have fun
You can use mod_bw on apache2 to limit the speed of which files get uploaded.
cd /root/
wget http://bwmod.sourceforge.net/files/mod_bw-0.7.tgz
tar -zxvf mod_bw-0.7.tgz
cd mod_bw
apxs -i -a -c mod_bw.c
That's mod_bw installed, now you just have to configure the virtual templates.
Examples:
Limit every user to a max of 10Kb/s on a vhost :
<Virtualhost *>
BandwidthModule On
ForceBandWidthModule On
Bandwidth all 10240
MinBandwidth all -1
Servername www.example.com
</Virtualhost>
Limit al internal users (lan) to 1000 kb/s with a minimum of 50kb/s , and
files greater than 500kb to 50kb/s.
<Virtualhost *>
BandwidthModule On
ForceBandWidthModule On
Bandwidth all 1024000
MinBandwidth all 50000
LargeFileLimit * 500 50000
Servername www.example.com
</Virtualhost>
Limit avi and mpg extensions to 20kb/s.
<Virtualhost *>
BandwidthModule On
ForceBandWidthModule On
LargeFileLimit .avi 1 20000
LargeFileLimit .mpg 1 20000
Servername www.example.com
</Virtualhost>
Using it the "right" way, with output filter by mime type (for text)
to 5kb/s:
<Virtualhost *>
BandwidthModule On
AddOutputFilterByType MOD_BW text/html text/plain
Bandwidth all 5000
Servername www.example.com
</Virtualhost>
Once configured virtual hosts you will have to restart httpd:
Redhat/Fedora: service httpd restart
Debian: /etc/init.d/httpd restart
Have fun

Last edited: