| Author |
Message |
Blacky
Primary Master


Joined: Apr 19, 2003
Posts: 312
|
Posted:
Jan 06, 2005 - 12:09 PM |
|
|
This is a further developed version of mod_bandwidth that you'll find at http://www.cohprog.com/mod_bandwidth.html
I added a MaxConnectionPerIP directive, so you can limit the maximum connection each particular IP is allowed to open to your Directory, Server or Virtual Server directive you've defined in your httpd.conf.
It's especially useful to prevent leechers from leeching with a lot of connections to rip other downloaders bandwidth and wasting apache connections.
This was the primary reason that I needed it for. I had tried mod_limitipconn, but wondered, why it blocks a directory or virtual server that was set to 1 connection, if there were current connections to other directories or virtual servers where no limit was set. I checked the code, and knew why. mod_limitipconn counts all of apaches concurrent connections for a specific IP! Independent of the directory or virtual server. So it was useless for my purpose and because I already loved mod_bandwidth, I thought: Hey, do you first open source submit.
Below you can download mod_bandwidth_206.tar.bz2 which includes only the updated mod_bandwidth.c file. Grab all other and documentation from http://www.cohprog.com/mod_bandwidth.html.
Notice: You've to create an additional directory for the connection data (/tmp/apachebw/conn), even if you've already setup a previous version of mod_bandwidth! See also point 3) of the instructions in mod_bandwidth.c
Hope you'll find this new directive (MaxConnectionPerIP) as useful as I do.
Remember: Keep the leechers dry.
Description from the source:
| Code: | * - MaxConnectionPerIP
* Syntax : MaxConnectionPerIP <domain|ip|all> <connections>
* Default : 0 (illimited)
* Context : per directory, .htaccess
*
* Restrict the number of maximum simultanous connections per IP from IP/Host or all.
* Whereas the meaning of "all" is "each".
* Example : MaxConnectionPerIP all 1
* This will restrict each IP to max 1 connection at a time.
* If the limit is reached, new connections will be rejected.
* You can combine this with MaxConnection to set a general connection limit
*
* A value of 0 means that there isn't any limits. |
Latest changes:
| Code: | * 10/25/04 - Add MaxConnectionPerIP directive to limit the
* number of simultaneous connections per IP
* You've to create a directory for the connection data
* /tmp/apachebw/conn, also see point 3) below
* Added by Michael Ritter <xxx@xxx.xx> (Real in the source)
* http://www.hdtvtotal.com/mod_bandwidth.html |
|
| Description: |
|
 Download |
| Filename: |
mod_bandwidth_206.tar.bz2 |
| Filesize: |
12.16 KB |
| Downloaded: |
1348 Time(s) |
_________________
-=] Hardware für Wahnsinnige | Hardware for insanes [=-
Last edited by Blacky on Jun 18, 2005 - 11:32 AM; edited 4 times in total |
|
|
 |
tenka
TV Newbie

Joined: May 12, 2005
Posts: 1
|
Posted:
May 12, 2005 - 03:25 PM |
|
|
hi everybody ,
i found this module for apache and i thank the creator because i was looking for this directive everywhere.
I just have some prob to implement it.i was used to mod_bandwidth but this version isn't working.
i still can download to full bandwidth and any simultaneous files that i want.
thanks in advance for you help. |
|
|
|
|
 |
| |  |
Blacky
Primary Master


Joined: Apr 19, 2003
Posts: 312
|
Posted:
Jun 18, 2005 - 11:00 AM |
|
|
Okay, got the time to test my version with the latest apache 1.3.x, and found no problem so far.
Maybe you didn't create the directory for the connection data?
/tmp/apachebw/conn
| Code: |
* 3) Create the following directories with "rwx" permission to everybody :
* (or rwx for the user under which Apache run : Usualy "nobody")
* /tmp/apachebw
* /tmp/apachebw/link
* /tmp/apachebw/master
* /tmp/apachebw/conn
|
I'll make this info more visible, as a lot of people, that're already used to mod_bandwidth, will probably miss this point, because they will asume that everything is already setup the right way from the previous version.
I hope you got/get it working, please let me know. |
_________________
-=] Hardware für Wahnsinnige | Hardware for insanes [=- |
|
|
|
|
| |