apache2 mod_bw

zz from: http://final.52mdj.com/archives/67.html
mod_limitipconn
和mod_bw这2个模块
至于怎么装什么的搜索一下就可以
编译mod_bw 之后出现如下错误
httpd: Syntax error on line 203 of /usr/local/apache22/conf/httpd.conf: Cannot load /usr/local/apache22/modules/mod_bw.so into server: /usr/local/apache22/modules/mod_bw.so: undefined symbol: apr_atomic_add
不要慌
修改一下mod_bw.c 就可以
#ifdef APR_MAJOR_VERSION   //添加这行
#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
#endif  //添加这行  重新编译就 ok
 
 
配置:
 
LoadModule bw_module          modules/mod_bw.so
<Directory />
### limit every client’s traffic to 50kb/s#######
  BandwidthModule On
  ForceBandWidthModule On
  Bandwidth all 50000
  MinBandwidth all -1
#######################################
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
</Directory>

This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>