Description:
============

mod_bandwidth is a lighttpd (http://www.lighttpd.net/) plugin to support 
bandwidth tracking and limiting. It allows for limiting on a per-context basis
and for any aribtrary period of time or bandwidth. It is intended to be accurate
bit-for-bit for any data sent from the server, despite large amounts of data
being transferred. It also allows for users to track the bandwidth used by their
sites and get real-time feedback of how close they are to their limits. 


Installation:
==============

See INSTALL file


Configuration:
==============

# status-url is the location you would like to have the status page that 
# displays limits and bandwidth usage. In this example, http://server/bandwidth 
# would show the correct page. This is a global-only option.
bw.status-url = "/bandwidth"             
# state-file is the location to store the state of bandwidth usage to allow for
# restarts without losing any statistics. File is written to every 30 seconds.
# This is a global-only option
bw.state-file = "/var/log/lighttpd/dev-bwstate"

# This is the bandwidth transfer you would like to limit the context to over
# the period of time listed below. For bandwidth, the following postfixes are 
# valid: g = Gigabyte, m = Megabyte, k = Kilobyte, none = Kilobyte
# For the time period, the following prefixes are valid:
# d = Days, h = Hours, m = Minutes, s = Seconds, none = Seconds
# limit and period are both per-context options.
bw.limit = "25g"
bw.period = "24h"

# As a note, the global context tracks bandwidth separately from any other
# contexts.  So in this example, the server could hit the 25GB limit, but 
# this will not affect www.domain.com. 
$HTTP["host"] == "www.domain.com" {     
  bw.limit = "10g"
  bw.period = "30d"
}

# Limits trickle down, so in this case it would take on the 25GB limit from the
# global context, but maintain it over a 7 day period.
$HTTP["host"] == "www.otherdomain.com" {     
  bw.period = "7d"
}
