当前位置: 首页 > others > 正文

Apache 的带宽控制

最近想针对apche的带宽做控制

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.

BandwidthModule On

ForceBandWidthModule On

Bandwidth all 1024000

MinBandwidth all 50000

LargeFileLimit * 500 50000

Servername www.example.com

Limit avi and mpg extensions to 20kb/s.

BandwidthModule On

ForceBandWidthModule On

LargeFileLimit .avi 1 20000

LargeFileLimit .mpg 1 20000

Servername www.example.com

Using it the “right” way, with output filter by mime type (for text)

to 5kb/s:

BandwidthModule On

AddOutputFilterByType MOD_BW text/html text/plain

Bandwidth all 5000

Servername www.example.com

本文固定链接: https://www.2hei.net/2007/04/25/apache-%e7%9a%84%e5%b8%a6%e5%ae%bd%e6%8e%a7%e5%88%b6/ | 2hei.net

该日志由 u2 于2007年04月25日发表在 others 分类下,
原创文章转载请注明: Apache 的带宽控制 | 2hei.net

报歉!评论已关闭.