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>

 

ubuntu apache2 流量限制模块的更多相关文章

  1. apache2服务器mod_rewrite模块 开启方法[linux, ubuntu]

    在UBUNTU系统中要启用mod_rewrite的方法有两种: 第一种: 在终端中执行 sudo a2enmod rewrite 指 令后,即启用了 Mod_rewrite 模块, apache2服务 ...

  2. Ubuntu 14 中给 APACHE2安装 SSL 模块 Enable SSL site on Ubuntu 14 LTS, Apache 2.4.7:

    Ubuntu 14 中给 APACHE2安装 SSL 模块 Enable SSL site on Ubuntu 14 LTS, Apache 2.4.7: 参考 http://blog.csdn.ne ...

  3. 转 - ubuntu apache2下目录结构

    ubuntu apache2下目录结构 原文:http://blog.csdn.net/jibcy/article/details/8060651 在Windows下,Apache的配置文件通常只有一 ...

  4. ubuntu apache开启重写模块

    http://www.iblue.cc/2011/09/ubuntu-apache%E5%BC%80%E5%90%AF%E9%87%8D%E5%86%99%E6%A8%A1%E5%9D%97/ Ubu ...

  5. ubuntu apache2配置详解(含虚拟主机配置方法)

    ubuntu apache2配置详解(含虚拟主机配置方法) 在Windows下,Apache的配置文件通常只有一个,就是httpd.conf.但我在Ubuntu Linux上用apt-get inst ...

  6. ubuntu apache2下目录结构以及重写规则

    ubuntu apache2下目录结构 在Windows下,Apache的配置文件通常只有一个,就是httpd.conf.但我在Ubuntu Linux上用apt-get install apache ...

  7. 虚拟主机的搭建(ubuntu+apache2)

    搭建环境:windows+VMware(Ubuntu)+apache2.(同一IP,不同域名) 1:在VMware的虚拟机Ubuntu下安装apache2(怎么安装百度一下就能找到): 2: apac ...

  8. ubuntu apache2 虚拟主机服务

    ubuntu apache2 虚拟主机服务 本次配置的是一个 ip 对应多个 虚拟主机 1:先检查 ubuntu server 是否已经安装了 apache2 web服务: apache2 -v 看到 ...

  9. SEER流量众筹模块开发测试网络及使用文档发布

    SEER利用区块链奖励机制,可解决传统体育赛事痛点,提高行业运转效率.比如提高赛事方收入,让观众自由选择想看的比赛,给予赛事众筹的参与者贡献影响力,使其获得由智能合约量化的激励等.此功能可广泛应用于包 ...

随机推荐

  1. Sublime Text学习笔记

    1.快捷键(Key Bindings)   Preferences -> Key Bindings ->Default   会打开一个配置文件,里面全是配置信息 2.代码片段(Snippe ...

  2. redis数据类型:hashes

    redis hash 是一个string类型的field和value的映射表. 它的添加.删除操作都是O(1)(平均),hash特别适合用于存储对象 将一个对象存储在hash类型总会占用更少的内存,并 ...

  3. js 中创建对象

    对象是什么 从JavaScript定义上讲对象是无序属性的集合,其属性可以包含基本值.对象或函数.也就是说对象是一组没有特定顺序的属性,每个属性会映射到一个值上,是一组键值对,值可以是数据或对象. 最 ...

  4. 浅谈hbase表中数据导出导入(也就是备份)

    转自:http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=23916356&id=3321832 最近因为生产环境hbase ...

  5. 9---PIP 管理工具的使用

    Python 不仅有强大的内置模块,还提供强大的三方模块. 官方网站: https://pypi.python.org/pypi 要适用三方的模块需要使用pip管理工具. 1.在安装pip前,请确认w ...

  6. unity Mesh(网格)的使用

    创建两个三角形合成的矩形网格: GameObject obj= new GameObject(); MeshRenderer meshRenderer=obj.AddComponent<Mesh ...

  7. HIT Winter Day ACM入门

    A. Arpa’s hard exam and Mehrdad’s naive cheat 题意:统计1378^n的末尾数字 即统计8^n的末尾数字 n=0时为1 其他情况为{8,4,2,6}中的一个 ...

  8. weaver_oa

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...

  9. vbs鼠标方法——模拟鼠标按键

    '*********************************************************************** ' 代码开始 '******************* ...

  10. Chapter 2 Open Book——8

    But as far as I could tell, life worked that way most of the time. 但是即使我这么说,生活大多数时间还是这样的. 但就我所能告诉你的, ...