Linux下Apache安装、配置和优化
作者: 出处:it世界 更新时间:2007-10-01 责任编辑:
 
 

  一些关于安全性的配置:
  
  考虑到 cgi-bin 的安全性问题,我们暂时将 cgi-bin 去掉。将所有 httpd.conf 中的所有关于 cgi-bin 的行加上 #.

  Xiyang 的配置

  我用的: mod_limitipconn, mod_expires, mod_gzip, mod_php4, mod_so, mod_access, mod_alias, mod_userdir, mod_dir, mod_autoindex, mod_status, mod_mime, mod_log_config, http_core
  
  关于超时的问题

  在我编写好所有的产品查看页面的时候,经常会出现因为超时,或者流量过大 ,apache 停止工作的问题,原因有二,一是代码的不科学性,二是 apache 的设置问题。
  
  以下是对设置的一点改动:
  
  代码:

# KeepAlive: Whether or not to allow persistent connections(more than
  # one request per connection). Set to "Off" to deactivate.
    # KeepAlive Off
    # MaxKeepAliveRequests: The maximum number of requests to allow
  # during a persistent connection. Set to 0 to allow an unlimited amount.
  # We recommend you leave this number high, for maximum performance.
    # MaxKeepAliveRequests 0
    # KeepAliveTimeout: Number of seconds to wait for the next request
  # from the same client on the same connection.
    # KeepAliveTimeout 0

  • 记录访问者的 HTTP-REFERER 和 AGENT, 有助于统计来者是通过什么搜索引擎找到我们的网站的。 或者在原有的CustomLog行,将参数由 common 改成 combined

  代码:

# If you would like to have agent and referer logfiles,
  # uncomment the following directives.
  CustomLog logs/referer_log referer
         CustomLog logs/agent_log agent
   CustomLog logs/www.domain.com-access_log combined

  使用 mod_limitipconn.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).

 
     
 
 
后退<<上一页 继续>>Apache
[上一页][第1页][第2页][第3页][下一页]
 
内容导航  
第1页Linux下Apache安装、配.. 第2页Linux下Apache安装、配..
第3页Apache
上一篇 : Apache下的WEB环境编译配.. 下一篇如何让Win XP减肥的十大..
 
  您要为所发表的言论的后果负责,请各位遵纪守法并注意文明用语
标题:  

[ 关于本站 ] [ 广告服务 ] [ 商务合作 ] [ 联系我们 ] [ 合作伙伴 ] [ 法律顾问 ] [ 网站地图 ]
千橡公司 京ICP证041489号 Copyright (c) 1997-2007 All Right Reserved.