设为首页 收藏本站
查看: 442|回复: 0

[经验分享] WDCP V3 安装mod

[复制链接]

尚未签到

发表于 2018-11-18 10:40:12 | 显示全部楼层 |阅读模式
  插件下载地址  http://down.51cto.com/data/2334352
  本文讲述的是 在使用wdcp网站环境下, 如何安装mod-cband插件
  软件版本号
  wdcp
  apache 2.4.23
  cband
  mod-cband-0.9.6.1
  在安装前先介绍一下其他的
  wdcp的apache 目录
  /www/wdlinux/httpd-2.4.23
  在安装插件时 需要用到一个组件“apxs”,目录为
  /www/wdlinux/httpd-2.4.23/bin/apxs
  ————————————————————————————————————————
  接下来我们安装插件

  •   创建下载插件的目录
      mkdir -p /usr/local/share/soft
      cd /usr/local/share/soft
      并将软件下载到当前目录(当然了,你也可以自己创建,随意)
  •   安装软件
      a.解压软件 tar -zxvf mod-cband-0.9.6.1.tgz -C /usr/local/share/soft/
      b.进入目录 /usr/local/share/soft/mod-cband-0.9.6.1
      c.配置 ./configure --with-apxs=/www/wdlinux/httpd-2.4.23/bin/apxs
      d.编译 make 出现了错误,见下面
      修改当前软件的mod-cband.c  将里面的配置文件修改一下(只需要修改提示行数,不要全部修改)
      remote_ip 改为 client_ip
      remote_addr 改为 client_addr
      e.编译安装 make install
  下面是编译时报的错误,
/www/wdlinux/httpd-2.4.23/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -c src/mod_cband.c
/www/wdlinux/httpd-2.4.23/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic   -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/www/wdlinux/httpd-2.4.23/include  -I/www/wdlinux/httpd-2.4.23/include   -I/www/wdlinux/httpd-2.4.23/include  -Wall -DDST_CLASS=3  -c -o src/mod_cband.lo src/mod_cband.c && touch src/mod_cband.slo
src/mod_cband.c: In function 'mod_cband_set_random_pulse':
src/mod_cband.c:416: warning: cast to pointer from integer of different size
src/mod_cband.c: In function 'mod_cband_set_limit':
src/mod_cband.c:436: warning: pointer targets in passing argument 2 of 'mod_cband_conf_get_limit_kb' differ in signedness
src/mod_cband.c:68: note: expected 'int *' but argument is of type 'unsigned int *'
src/mod_cband.c: In function 'mod_cband_set_user_limit':
src/mod_cband.c:651: warning: pointer targets in passing argument 2 of 'mod_cband_conf_get_limit_kb' differ in signedness
src/mod_cband.c:68: note: expected 'int *' but argument is of type 'unsigned int *'
src/mod_cband.c: In function 'mod_cband_set_class_limit':
src/mod_cband.c:874: warning: pointer targets in passing argument 2 of 'mod_cband_conf_get_limit_kb' differ in signedness
src/mod_cband.c:68: note: expected 'int *' but argument is of type 'unsigned int *'
src/mod_cband.c: In function 'mod_cband_set_user_class_limit':
src/mod_cband.c:899: warning: pointer targets in passing argument 2 of 'mod_cband_conf_get_limit_kb' differ in signedness
src/mod_cband.c:68: note: expected 'int *' but argument is of type 'unsigned int *'
src/mod_cband.c: In function 'mod_cband_create_traffic_size':
src/mod_cband.c:1010: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1010: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1014: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1014: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c: In function 'mod_cband_get_dst':
src/mod_cband.c:1281: error: 'conn_rec' has no member named 'remote_ip'
src/mod_cband.c: In function 'mod_cband_get_remote_host':
src/mod_cband.c:1310: error: 'struct conn_rec' has no member named 'remote_ip'
src/mod_cband.c:1311: error: 'struct conn_rec' has no member named 'remote_ip'
src/mod_cband.c:1313: error: 'struct conn_rec' has no member named 'remote_addr'
src/mod_cband.c: In function 'mod_cband_filter':
src/mod_cband.c:3236: warning: passing argument 3 of 'b->type->read' from incompatible pointer type
src/mod_cband.c:3236: note: expected 'apr_size_t *' but argument is of type 'int *'
apxs:Error: Command failed with rc=65536
.
make: *** [src/.libs/mod_cband.so] 错误 1  修改后 make
/www/wdlinux/httpd-2.4.23/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -c src/mod_cband.c
/www/wdlinux/httpd-2.4.23/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic   -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/www/wdlinux/httpd-2.4.23/include  -I/www/wdlinux/httpd-2.4.23/include   -I/www/wdlinux/httpd-2.4.23/include  -Wall -DDST_CLASS=3  -c -o src/mod_cband.lo src/mod_cband.c && touch src/mod_cband.slo
src/mod_cband.c: In function 'mod_cband_set_random_pulse':
src/mod_cband.c:416: warning: cast to pointer from integer of different size
src/mod_cband.c: In function 'mod_cband_set_limit':
src/mod_cband.c:436: warning: pointer targets in passing argument 2 of 'mod_cband_conf_get_limit_kb' differ in signedness
src/mod_cband.c:68: note: expected 'int *' but argument is of type 'unsigned int *'
src/mod_cband.c: In function 'mod_cband_set_user_limit':
src/mod_cband.c:651: warning: pointer targets in passing argument 2 of 'mod_cband_conf_get_limit_kb' differ in signedness
src/mod_cband.c:68: note: expected 'int *' but argument is of type 'unsigned int *'
src/mod_cband.c: In function 'mod_cband_set_class_limit':
src/mod_cband.c:874: warning: pointer targets in passing argument 2 of 'mod_cband_conf_get_limit_kb' differ in signedness
src/mod_cband.c:68: note: expected 'int *' but argument is of type 'unsigned int *'
src/mod_cband.c: In function 'mod_cband_set_user_class_limit':
src/mod_cband.c:899: warning: pointer targets in passing argument 2 of 'mod_cband_conf_get_limit_kb' differ in signedness
src/mod_cband.c:68: note: expected 'int *' but argument is of type 'unsigned int *'
src/mod_cband.c: In function 'mod_cband_create_traffic_size':
src/mod_cband.c:1010: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1010: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1014: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1014: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c: In function 'mod_cband_filter':
src/mod_cband.c:3236: warning: passing argument 3 of 'b->type->read' from incompatible pointer type
src/mod_cband.c:3236: note: expected 'apr_size_t *' but argument is of type 'int *'
/www/wdlinux/httpd-2.4.23/build/libtool --silent --mode=link gcc -std=gnu99    -o src/mod_cband.la  -rpath /www/wdlinux/httpd-2.4.23/modules -module -avoid-version    src/mod_cband.lo
write "make install" to install module  编译安装 make install
/www/wdlinux/httpd-2.4.23/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -i -a -n cband src/mod_cband.la
/www/wdlinux/httpd-2.4.23/build/instdso.sh SH_LIBTOOL='/www/wdlinux/httpd-2.4.23/build/libtool' src/mod_cband.la /www/wdlinux/httpd-2.4.23/modules
/www/wdlinux/httpd-2.4.23/build/libtool --mode=install install src/mod_cband.la /www/wdlinux/httpd-2.4.23/modules/
libtool: install: install src/.libs/mod_cband.so /www/wdlinux/httpd-2.4.23/modules/mod_cband.so
libtool: install: install src/.libs/mod_cband.lai /www/wdlinux/httpd-2.4.23/modules/mod_cband.la
libtool: install: install src/.libs/mod_cband.a /www/wdlinux/httpd-2.4.23/modules/mod_cband.a
libtool: install: chmod 644 /www/wdlinux/httpd-2.4.23/modules/mod_cband.a
libtool: install: ranlib /www/wdlinux/httpd-2.4.23/modules/mod_cband.a
libtool: finish: PATH="/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/www/wdlinux/mysql/bin:/root/bin:/sbin" ldconfig -n /www/wdlinux/httpd-2.4.23/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /www/wdlinux/httpd-2.4.23/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /www/wdlinux/httpd-2.4.23/modules/mod_cband.so
[activating module `cband' in /www/wdlinux/httpd-2.4.23/conf/httpd.conf]  3.修改配置文件(虚拟主机的配置文件)
  /www/wdlinux/httpd-2.4.23/conf/vhost/XXXXX
  上面的XXXXX 代表你自己创建的网站
  添加以下代码
  CBandSpeed 5096 10 30   代表最大带宽
  CBandRemoteSpeed 200kb/s 3 3 代表每用户最大速度为200kb 最大每秒 3 个请求和最大每秒 3 个连接
  如下代码

DocumentRoot /www/web/cband_test_com/public_html
ServerName cband.quanttech.com
ErrorDocument 400 /errpage/400.html
ErrorDocument 403 /errpage/403.html
ErrorDocument 404 /errpage/404.html
ErrorDocument 503 /errpage/503.html
php_admin_value open_basedir /www/web/cband_test_com:/tmp
CBandSpeed 5096 10 30
CBandRemoteSpeed 200kb/s 3 3

    DeflateCompressionLevel 7
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
    AddOutputFilter DEFLATE css js html htm gif jpg png bmp php



    Options FollowSymLinks
    AllowOverride All
    Require all granted
  重启apache 服务
  service httpd restart
  每次修改上面的参数 都要重启一下apache 服务
  其他代码表示的功能请自行在百度一下




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-636500-1-1.html 上篇帖子: Apache自带日志切割工具Logrotate和maxage-Sky 下篇帖子: 8.Apache服务器
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表