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. 【编码问题】if,for语句与中文编码

    1. 首先先来说说中文的问题.众所周知,作死的python经常和中文过不去 每次,开头必须声明 # coding: utf-8 或者是 # -*- coding: utf-8  -*- 然而,被坑过的 ...

  2. HyperSnap(屏幕抓图工具) 8.11.03 官方简体中文特别版

    软件名称:屏幕抓图工具HyperSnap 软件分类:图像捕捉运行环境:WinXP/Win2003/Vista/Win7/Win8/WinALL软件语言:简体中文授权方式:免费软件软件大小:12462K ...

  3. 杭电15题 The Cow Lexicon

    Problem Description Few know that the cows have their own dictionary with W (1 ≤ W ≤ 600) words, eac ...

  4. 使用block函数的基本形式

    以前从未接触过block函数. 如果在.h头文件中定义的形式如下的话: @property (nonatomic, copy) void(^fontValueChangedBlock)(void); ...

  5. Centos 6.5升级到Git2.1.2的步骤

    Centos 6.5升级到Git2.1.2的步骤 Centos 6.5升级到Git2.1.2其实是非常的简单,因这款版本控制程序非常的好用,所以小编自己也是使用它了,下面一起来看看Centos 6.5 ...

  6. 浅析PageRank算法

    很早就对Google的PageRank算法很感兴趣,但一直没有深究,只有个轮廓性的概念.前几天趁团队outing的机会,在动车上看了一些相关的资料(PS:在动车上看看书真是一种享受),趁热打铁,将所看 ...

  7. H5的新应用-拖到页面上的元素

    -------------------------- <script type="text/javascript">                        // ...

  8. python 输出重定向

    使print既打印到终端,又写入文件 class Tee(object): def __init__(self,*files): self.files = files def write(self,o ...

  9. 深入理解JAVA的多态性[转]

    昨天看到一个关于多态性的帖子,参考了回帖者的理解,加入了一些自己的看法,整理出来供大家参考,不一定完全正确,欢迎大家批评指正. (一)相关类 class A ...{         public S ...

  10. LVS负载均衡的三种模式和八种算法总结

    三种LVS负载均衡模式 调度器的实现技术中,IP负载均衡技术是效率最高的,IP虚拟服务器软件(IPVS)是在linux内核中实现的。 LVS负载均衡模式---1.NAT模式 NAT用法本来是因为网络I ...