ubuntu apache2 流量限制模块
mod-bw is an Apache 2 module provided to solve the problem of limiting users’ and virtual hosts’ bandwidth usage. The current versions can set virtual hosts’ and users’ bandwidth quotas, maximal download speed, requests-per-second speed and the maximal number of simultaneous IP connections.
mod-bw Features:
* Lightweight bandwidth limiting module for Apache2
* per-user bandwidth limiting
* per-virtual host bandwidth limiting
* per-destination bandwidth limiting
Limiting:
* Bandwidth total usage (bandwidth quota)
* Maximal download speed (bandwidth throttling)
* Maximal requests-per-second speed
* Maximal simultaneous IP connections
* Support for virtual hosts
* Support for defined users
Installing mod-bw:
Open the terminal and type following command to install mod-bw
1
|
apt-get install libapache2-mod-bw |
Now enable the module by using the a2enmod command (from terminal):
1
|
sudo a2enmod bw |
Below example is showing how to place the bandwidth limit for a given virtual hosts:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<VirtualHost *:8080> ServerName www.abc.com ServerAlias www.abc.com DocumentRoot /var/www/abc # Turn bandwidth limitation on BandwidthModule On # force limitation on every request ForceBandWidthModule On # limit to 500kB/s Bandwidth all 504800 # Setup custom error message ErrorDocument 510 /errors/maxconexceeded .html BandWidthError 510 # Limit avi and mpg extensions to 20kb/s. LargeFileLimit .avi 1 20000 LargeFileLimit .mpg 1 20000 < /VirtualHost >
|
最新文章
- Top Coder算法题目浏览器
- display:none与visible:hidden的区别
- BCP 数据的导入和导出
- git 常用指令
- bzoj3745: [Coci2015]Norma
- vs2012 智能提示消失解决办法
- sublime-text3插件安装
- OpenGL9-(FreeImage)加载图片-作为纹理
- 如何在C++中使用WebService
- Windows 10正式版密钥大全,Win10激活序列号KEY大全
- 动态分配内存补充 realloc
- 父(Spring)子(SpringMVC)容器之初解篇
- 【Netty源码分析】发送数据过程
- Android绘制优化(二)布局优化
- mysql对身份证号码进行脱敏处理
- 【bzoj1042】[HAOI2008]硬币购物 背包dp+容斥原理
- 关于摄影O2O的前期准备
- Javascript创建类的七种方法
- [转载]Supporting OData $inlinecount with the new Web API OData preview package
- 逆序对 inversion