带宽控制 for apache2
时间:2007-02-27 来源:cbs20
带宽控制 for apache2
wget http://apache.ivn.cl/files/source/mod_bw-0.7.tgz
tar -zxvf mod_bw-0.7.tgz
/usr/local/apache/bin/apxs -i -a -c mod_bw.c
vi /usr/local/apache/conf/httpd.conf
确信:
LoadModule bw_module modules/mod_bw.so vi httpd.conf 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>
确信:
LoadModule bw_module modules/mod_bw.so vi httpd.conf 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>
相关阅读 更多 +