相信專業,給你品質
專營建築物防水、抓漏、除壁癌、拆除工程
冷氣直接提供客戶給您,每天提供給您新客戶帶來新商機
不用再花高額的廣告費做些沒效果的廣告

首頁  •  j2h 論壇 • 程式設計討論     • 

apache2使用 mod_limitipconn

房東:小橋
發表時間:2007-02-24
[檢舉]


.c 來限制 apache 的並發數

Package: http://dominia.org/djao/limit/這裡的安裝建議使用動態 DSO 並 patch apache2.0, 以使得 apache2.0 可以認識在代理後方的 IP 。但是要 重新編譯 apache2.0, 以下是介紹。

代碼:


  ##Instructions for building DSO with proxy tracking:
  # tar xzvf httpd-2.0.39.tar.gz
  # tar xzvf mod_limitipconn-0.22.tar.gz
  # cd httpd-2.0.39
  # patch -p1 < ../mod_limitipconn-0.22/apachesrc.diff
  # ./buildconf
  # ./configure --enable-so --enable-speling --enable-rewrite --with-ssl=/usr/local/ssl --enable-forward
  # make
  # make install
  # cd ../mod_limitipconn-0.22
  # PATH=/usr/local/apache2/bin:$PATH
  # make install



安裝過程


  
  # lynx http://dominia.org/djao/limit/mod_limitipconn-0.22.tar.gz
  # tar -zxvf mod_limitipconn-0.22.tar.gz
  # cd httpd-2.0.48
  # patch -p1 < ../mod_limitipconn-0.22/apachesrc.diff
  patching file configure.in
  Hunk #1 succeeded at 373 (offset 55 lines).
  patching file include/scoreboard.h
  patching file modules/generators/mod_status.c
  Hunk #1 succeeded at 746 (offset -1 lines).
  patching file server/scoreboard.c
  # ./configure --enable-so --enable-speling --enable-rewrite --with-ssl=/usr/local/ssl --enable-forward
  # make
  # make install
  # cd ../mod_limitipconn-0.22
  # PATH=/usr/local/apache2/bin:$PATH
  # make install
  ----------------------------------------------------------------------
  Libraries have been installed in:
  /usr/local/apache2/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 /usr/local/apache2/modules/mod_limitipconn.so
  [activating module `limitipconn\' in /usr/local/apache2/conf/httpd.conf] 
 


 

檢查 httpd.conf 檔案,發現增加了一下一行

代碼:

LoadModule limitipconn_module modules/mod_limitipconn.so 

同時需要設定以下參數在 httpd.conf 中 , 也可以在單個虛擬伺服器中。

代碼:


  ExtendedStatus On
  # Only needed if the module is compiled as a DSO
  LoadModule limitipconn_module lib/apache/mod_limitipconn.so
  
  
  MaxConnPerIP 3
  # exempting images from the connection limit is often a good





  • 贊助網站       

    廣利不動產-新板特區指名度最高、值得您信賴的好房仲
    您的托付,廣利用心為您服務
    廣利不動產-板橋在地生根最實在--新板特區指名度最高、值得您信賴的好房仲
    完整房訊,房屋、店面熱門精選物件,廣利不動產 優質仲介,房屋租賃、買賣資訊透明,交易真安心!



  •  共 0 人回應

    姓名:
    佈告內容: