使用mod_limitipconn.c來限制apache的併發數(轉載)

火星人 @ 2014-03-04 , reply:0


使用mod_limitipconn.c來限制apache的併發數(轉載)

我編譯出錯
/usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-pic  -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache/include  -c -o mod_limitipconn.lo mod_limitipconn.c && touch mod_limitipconn.slo
mod_limitipconn.c:39: parse error before `limitipconn_module'
mod_limitipconn.c:39: warning: data definition has no type or storage class
mod_limitipconn.c:43: parse error before `array_header'
mod_limitipconn.c:43: warning: no semicolon at end of struct or union
mod_limitipconn.c:45: warning: data definition has no type or storage class
mod_limitipconn.c:47: parse error before `}'
mod_limitipconn.c:47: warning: data definition has no type or storage class
mod_limitipconn.c:49: parse error before `*'
mod_limitipconn.c: In function `limitipconn_create_dir_config':
mod_limitipconn.c:51: `cfg' undeclared (first use in this function)
mod_limitipconn.c:51: (Each undeclared identifier is reported only once
mod_limitipconn.c:51: for each function it appears in.)
mod_limitipconn.c:51: parse error before `)'
mod_limitipconn.c:56: `p' undeclared (first use in this function)
mod_limitipconn.c: In function `limitipconn_handler':
mod_limitipconn.c:65: `cfg' undeclared (first use in this function)
mod_limitipconn.c:65: parse error before `)'
mod_limitipconn.c:66: request for member `module_index' in something not a structure or union
mod_limitipconn.c:69: parse error before `char'
mod_limitipconn.c:84: `short_score' undeclared (first use in this function)
mod_limitipconn.c:95: `content_type' undeclared (first use in this function)
mod_limitipconn.c:95: too few arguments to function `ap_sub_req_lookup_uri'
mod_limitipconn.c:105: `address' undeclared (first use in this function)
mod_limitipconn.c:114: `i' undeclared (first use in this function)
mod_limitipconn.c:115: `nolim' undeclared (first use in this function)
mod_limitipconn.c:126: `exlim' undeclared (first use in this function)
mod_limitipconn.c:138: `HARD_SERVER_LIMIT' undeclared (first use in this function)
mod_limitipconn.c:139: `score_record' undeclared (first use in this function)
mod_limitipconn.c:142: case label not within a switch statement
mod_limitipconn.c:144: case label not within a switch statement
mod_limitipconn.c:146: case label not within a switch statement
mod_limitipconn.c:148: case label not within a switch statement
mod_limitipconn.c:150: case label not within a switch statement
mod_limitipconn.c:156: `ip_count' undeclared (first use in this function)
mod_limitipconn.c:160: case label not within a switch statement
mod_limitipconn.c:162: case label not within a switch statement
mod_limitipconn.c:164: case label not within a switch statement
mod_limitipconn.c:166: case label not within a switch statement
mod_limitipconn.c: In function `limit_config_cmd':
mod_limitipconn.c:190: `cfg' undeclared (first use in this function)
mod_limitipconn.c:190: parse error before `)'
mod_limitipconn.c: In function `no_limit_config_cmd':
mod_limitipconn.c:206: `cfg' undeclared (first use in this function)
mod_limitipconn.c:206: parse error before `)'
mod_limitipconn.c:208: warning: assignment makes pointer from integer without a cast
mod_limitipconn.c: In function `excl_limit_config_cmd':
mod_limitipconn.c:216: `cfg' undeclared (first use in this function)
mod_limitipconn.c:216: parse error before `)'
mod_limitipconn.c:218: warning: assignment makes pointer from integer without a cast
mod_limitipconn.c: At top level:
mod_limitipconn.c:224: warning: initialization from incompatible pointer type
mod_limitipconn.c:226: warning: initialization from incompatible pointer type
mod_limitipconn.c:228: warning: initialization from incompatible pointer type
mod_limitipconn.c:234: parse error before `pool'
mod_limitipconn.c: In function `limitipconn_init':
mod_limitipconn.c:235: `s' undeclared (first use in this function)
mod_limitipconn.c:236: warning: passing arg 5 of `ap_log_error' from incompatible pointer type
mod_limitipconn.c:236: too few arguments to function `ap_log_error'
mod_limitipconn.c: At top level:
mod_limitipconn.c:239: parse error before `limitipconn_module'
mod_limitipconn.c:240: `this_module_needs_to_be_ported_to_apache_2_0' undeclared here (not in a function)
mod_limitipconn.c:240: initializer element is not constant
mod_limitipconn.c:240: (near initialization for `limitipconn_module')
mod_limitipconn.c:241: warning: excess elements in scalar initializer
mod_limitipconn.c:241: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:242: warning: excess elements in scalar initializer
mod_limitipconn.c:242: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:243: warning: excess elements in scalar initializer
mod_limitipconn.c:243: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:244: warning: excess elements in scalar initializer
mod_limitipconn.c:244: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:245: warning: excess elements in scalar initializer
mod_limitipconn.c:245: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:246: warning: excess elements in scalar initializer
mod_limitipconn.c:246: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:247: warning: excess elements in scalar initializer
mod_limitipconn.c:247: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:248: warning: excess elements in scalar initializer
mod_limitipconn.c:248: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:249: warning: excess elements in scalar initializer
mod_limitipconn.c:249: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:250: warning: excess elements in scalar initializer
mod_limitipconn.c:250: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:251: warning: excess elements in scalar initializer
mod_limitipconn.c:251: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:252: warning: excess elements in scalar initializer
mod_limitipconn.c:252: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:253: warning: excess elements in scalar initializer
mod_limitipconn.c:253: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:254: warning: excess elements in scalar initializer
mod_limitipconn.c:254: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:255: warning: excess elements in scalar initializer
mod_limitipconn.c:255: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:256: warning: excess elements in scalar initializer
mod_limitipconn.c:256: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:257: warning: excess elements in scalar initializer
mod_limitipconn.c:257: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:259: warning: excess elements in scalar initializer
mod_limitipconn.c:259: warning: (near initialization for `limitipconn_module')
mod_limitipconn.c:259: warning: data definition has no type or storage class
apxs:Error: Command failed with rc=65536
《解決方案》

使用mod_limitipconn.c來限制apache的併發數(轉載)

版主搞錯了吧?這個怎麼是精華呀?
《解決方案》

使用mod_limitipconn.c來限制apache的併發數(轉載)

炫耀一下我寫的吧~~ 呵呵。

http://www.kreny.com/computer/linux/apache.html

[ 本帖最後由 jackieyuan 於 2006-10-4 19:46 編輯 ]
《解決方案》

使用mod_limitipconn.c來限制apache的併發數(轉載)

《解決方案》

使用mod_limitipconn.c來限制apache的併發數(轉載)

我安裝時也出了問題
/usr/local/apache/bin/apxs -ica mod_limitipconn.c
/usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-pic  -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -g -O2 -pthread -DRECORD_FORWARD -I/usr/local/apache/include  -I/usr/local/apache/include   -I/usr/local/apache/include   -c -o mod_limitipconn.lo mod_limitipconn.c && touch mod_limitipconn.slo
/usr/local/apache/build/libtool --silent --mode=link gcc -o mod_limitipconn.la  -rpath /usr/local/apache/modules -module -avoid-version    mod_limitipconn.lo
/usr/local/apache/build/instdso.sh SH_LIBTOOL='/usr/local/apache/build/libtool' mod_limitipconn.la /usr/local/apache/modules
/usr/local/apache/build/libtool --mode=install cp mod_limitipconn.la /usr/local/apache/modules/
cp .libs/mod_limitipconn.lai /usr/local/apache/modules/mod_limitipconn.la
cp .libs/mod_limitipconn.a /usr/local/apache/modules/mod_limitipconn.a
ranlib /usr/local/apache/modules/mod_limitipconn.a
chmod 644 /usr/local/apache/modules/mod_limitipconn.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/apache/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/apache/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.
----------------------------------------------------------------------
Warning!  dlname not found in /usr/local/apache/modules/mod_limitipconn.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache/modules/mod_limitipconn.so
chmod: failed to get attributes of `/usr/local/apache/modules/mod_limitipconn.so': No such file or directory
apxs:Error: Command failed with rc=65536

TO : jackieyuan  我照的你安裝方法Apache在make 時出錯 . 我的Apache 版本是 httpd-2.0.53
《解決方案》

使用mod_limitipconn.c來限制apache的併發數(轉載)

TO : jackieyuan  我照的你安裝方法在make install  時出錯 . 請問是什麼原因啊 ??

PATH=/usr/local/apache/bin:$PATH
# make install
apxs -c    mod_limitipconn.c
/usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-pic  -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -g -O2 -pthread -DRECORD_FORWARD -I/usr/local/apache/include  -I/usr/local/apache/include   -I/usr/local/apache/include   -c -o mod_limitipconn.lo mod_limitipconn.c && touch mod_limitipconn.slo
/usr/local/apache/build/libtool --silent --mode=link gcc -o mod_limitipconn.la  -rpath /usr/local/apache/modules -module -avoid-version    mod_limitipconn.lo
apxs -c -i -a -n 'limitipconn' mod_limitipconn.c
/usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-pic  -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -g -O2 -pthread -DRECORD_FORWARD -I/usr/local/apache/include  -I/usr/local/apache/include   -I/usr/local/apache/include   -c -o mod_limitipconn.lo mod_limitipconn.c && touch mod_limitipconn.slo
/usr/local/apache/build/libtool --silent --mode=link gcc -o mod_limitipconn.la  -rpath /usr/local/apache/modules -module -avoid-version    mod_limitipconn.lo
/usr/local/apache/build/instdso.sh SH_LIBTOOL='/usr/local/apache/build/libtool' mod_limitipconn.la /usr/local/apache/modules
/usr/local/apache/build/libtool --mode=install cp mod_limitipconn.la /usr/local/apache/modules/
cp .libs/mod_limitipconn.lai /usr/local/apache/modules/mod_limitipconn.la
cp .libs/mod_limitipconn.a /usr/local/apache/modules/mod_limitipconn.a
ranlib /usr/local/apache/modules/mod_limitipconn.a
chmod 644 /usr/local/apache/modules/mod_limitipconn.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/apache/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/apache/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.
----------------------------------------------------------------------
Warning!  dlname not found in /usr/local/apache/modules/mod_limitipconn.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache/modules/mod_limitipconn.so
chmod: failed to get attributes of `/usr/local/apache/modules/mod_limitipconn.so': No such file or directory
apxs:Error: Command failed with rc=65536
《解決方案》

使用mod_limitipconn.c來限制apache的併發數(轉載)

跟 libtool 有原因 ??

# find / -name 'libtool'
/tmp/httpd-2.0.53/srclib/apr/libtool
/tmp/httpd-2.0.53/srclib/apr-util/xml/expat/libtool
/tmp/php-5.0.3/libtool
/usr/bin/libtool
/usr/share/libtool
/usr/local/bin/libtool
/usr/local/apache/build/libtool
/usr/local/apr/build-1/libtool
《解決方案》

使用mod_limitipconn.c來限制apache的併發數(轉載)

盼高手解答。。。。
《解決方案》

使用mod_limitipconn.c來限制apache的併發數(轉載)

原帖由 "davisye"]ngs mod_limitipconn-0.22 發表:
# make install
apxs -c    mod_limitipconn.c
/usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-pic  -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT ..........

暈,對不起大家,我來晚了。
我看了看你的 path, 我用的是 apache 2.0 編譯的,你上面的 path 是 /usr/local/apache/  不是 /usr/local/apache2/ 。
先查一下是否把 path 寫正確了。  :D
《解決方案》

使用mod_limitipconn.c來限制apache的併發數(轉載)

沒看明白,這個為什麼是精華啊




[火星人 via ] 使用mod_limitipconn.c來限制apache的併發數(轉載)已經有175次圍觀

http://www.coctec.com/docs/service/show-post-24118.html