Apache 安装、配置、优化

http://tech.ddvip.com   2007年03月11日    社区交流

本文详细介绍Apache 安装、配置、优化

  代码:

  ##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
  <IfModule mod_limitipconn.c>
  <Location /somewhere>
  MaxConnPerIP 3
  # exempting images from the connection limit is often a good

作者:jdsf    责编:豆豆技术应用

正在加载评论...