" class="title" title="home again woohoo">Home ?> pages bg right
 Currently Browsing: Apache


Downloads for Bandwidth Mod

Apache Modules :

  • Currently there are two Apache2 modules available.

    bw_mod [a.k.a. mod_bandwidth]mod_vhost_limit
    Ivn Project License : [Download]



    Author : Ivan Barrera (Bruce)
    Contact E-Mail : Bruce (at ivn)
    Status : Stable
    Current Version : v0.8

    Files :

  • mod_bw v0.8 – Source Code – [Download][Readme]
  • mod_bw v0.8 – Windows Release for Apache 2.2.9 – [Download]
  • mod_bw v0.8 – Windows Release for Apache 2.0.63 – [Download]
  • mod_bw v0.8 – Windows Release for Apache 2.2.6 – [Download]
  • mod_bw v0.8 – Windows Release for Apache 2.2.4 – [Download]
  • mod_bw v0.7 – Windows Release for Apache 2.0.47 – [Download]
  • mod_bw v0.7 – Windows Release for Apache 2.0.48 – [Download]
  • mod_bw v0.7 – Windows Release for Apache 2.0.55 – [Download]
  • mod_bw v0.7 – Windows Release for Apache 2.2.0 – [Download]
  • mod_bw v0.7 – Windows Release for Apache 2.2.2 – [Download]
  • mod_bw v0.7 – Visual Studio Project – [Download][Readme]

    Purpose :

  • Restrict the number of simultaneous connections per vhost/dir
  • Limit the bandwidth for files on vhost/dir

    Changelog for v0.8 :

  • Added user agent match on bandwidth and connections limiting
  • Fixed issue of symbols not found on some platforms
  • Updated documentation accordingly

    Platforms :

  • Linux/x86/x86_64
  • FreeBSD/x86 v5.2
  • MacOS X/ppc x86
  • Solaris 8/sparc
  • Microsoft Windows
  • HP/UX 11

    If you have any comments, bug reports, feature request, etc, soon there will be
    a web-system to address all that stuff. Meanwhile, you can email me.

    Bw_Mod v0.7 Previous Version
    Bw_Mod v0.6 Still available, and with its README here.
    Bw_Mod v0.5 Stable is obsoleted, and should not be used, unless you want to play with it.
    Bw_Mod v0.5 RC1 is obsoleted, and should not be used, unless you want to play with it.
    Mod_bandwidth v0.1 is obsoleted, and should not be used.





    Author : Ivan Barrera (Bruce)
    Created On : 2004.02.24
    Last Modified : 2007.04.06
    Status : Functional
    Current Version : v0.2

    NAME
    mod_vhost_limit [Download

    PURPOSE
    Restrict the number of simultaneous connections per vhost

    HISTORY
    – &nbsp 2007.04.06
    Included some cleanup, and fixes suggested (and coded by) Chirouze Olivier
    – &nbsp 2004.02.26

    Added compile.sh , to ease the compiling proccess.
    – &nbsp 2004.02.24
    Initial revision 0.1

    COMMENTS

    Some people asked me about the original implementation for
    Apache 1.3.x. Takato Satsuma was who wrote that, but appears that
    his code has nowhere to be found.
    As i kept a copy of it, i’m leaving it for download here :
    mod_vhost_limit-0.4.tar.gz for apache 1.3.x

  • 

    Bandwidth Mod : MacOSX Troubles

    Well…
    Lot of time has passed since i released a stable version of mod_bw.
    Stable as it is, it isn’t free of problems.

    Frederik Temmermans contacted me a couple of weeks ago, and sent some errors he got compiling current version of mod_bw (0.8 as of now).
    He was running MacOSX 10.5.7 with standar Apache 2.2.11.

    When compiling normally using apxs, the module will be built and installed. But after starting apache, an error will appear :

    httpd: Syntax error on line 54 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/mod_bw.so into server:
    dlopen(/usr/libexec/apache2/mod_bw.so, 10): no suitable image found. Did find:
    /usr/libexec/apache2/mod_bw.so: mach-o, but wrong architecture
    

    So…. There is a binary.. but for the wrong architecture.
    As Mac’s nowadays are Intel based, to me it looks like it is a 32/64bits issue.

    As MacOSX is a hybrid system running 32 and 64bits apps (since some time), looks like apache is a 64bit application :

    G1X:mod_bw root# httpd -V
     Server version: Apache/2.2.11 (Unix)
     Server built:   Feb  3 2009 01:54:45
     Server's Module Magic Number: 20051115:21
     Server loaded:  APR 1.2.7, APR-Util 1.2.7
     Compiled using: APR 1.2.7, APR-Util 1.2.7
     Architecture:   64-bit
     Server MPM:     Prefork
      threaded:     no
      forked:     yes (variable process count)
    
    G1X:mod_bw root# uname -a
     Darwin G1X.local 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT
     2009; root:xnu-1228.12.14~1/RELEASE_I386 i386
    

    And it also seems that apxs is compiling a 32bit binary.
    (G1X is my Asus G1 laptop running OSX. Sorry Apple, I know i should not do this.. but it was a quick test to help. If anyone wants to donate a MacBookPro…. :X)

    Well, after realizing whats the problem, it is just a matter of adjusting some compiling flags.. Run apxs like this :

    apxs -c -i  -Wc,'-arch x86_64' -Wl,'-arch x86_64'  mod_bw.c
    

    And that’s it. You’ll have a 64bit module.

    ……………………

    Did i said that’s it ?
    Well.. Life is not an easy ride. After fixing this, Frederik had another issue. (I find this weird… i had a system setup to be similar to his, and i didn’t have this problem.)

    If loading the module you get an error like this one :

    httpd: Syntax error on line 117 of /private/etc/apache2/httpd.conf:
    Cannot load /usr/libexec/apache2/mod_bw.so into server:
    dlopen(/usr/libexec/apache2/mod_bw.so, 10): Symbol not found: _apr_atomic_add\n  Referenced from: /usr/libexec/apache2/mod_bw.so
    Expected in: dynamic lookup
    

    It is because that symbol (used in the module) is not in your current APR Lib version. I have seen this occur in some linux distros (but never happened to me… damn). When i first received an email regarding this bug, we came up with an easy fix, and it seemed to solve it. (did last a while…)

    Well, to fix it, you need to locate and erase this lines from mod_bw.c

    #if (APR_MAJOR_VERSION < 1)
        #define apr_atomic_inc32 apr_atomic_inc
        #define apr_atomic_dec32 apr_atomic_dec
        #define apr_atomic_add32 apr_atomic_add
        #define apr_atomic_cas32 apr_atomic_cas
        #define apr_atomic_set32 apr_atomic_set
    #endif
    

    Compile again, and that's it. (this time for real).

    In the next release (hope to be soon), i'll try to have this fixed once and for all.