Centos 7
yum install http://repo.unmanarc.com/CentOS/7/RPMS/x86_64/mod_bw-0.92-2.el7.centos.x86_64.rpm
rpm -ql mod_bw
sed -i 's@extramodules/mod_bw.so@modules/mod_bw.so@g' /etc/httpd/conf.d/mod_bw.conf
systemctl restart httpd
可能需要的元件:
yum -y install httpd-devel
yum -y install gcc
修改/etc/httpd/conf.d/mod_bw.conf(全域)
LoadModule bw_module modules/mod_bw.so
BandWidthModule On
ForceBandWidthModule On
BandWidth all 2621440
存檔後重新啟動httpd
也可以單獨限制某個目錄或虛擬站台,將
BandWidthModule On
ForceBandWidthModule On
BandWidth all 2621440
加在對應的位置下!