设为首页
加入收藏
成员单位
您现在的位置: 河北互联网 >> 虚拟主机 >> 文章正文
Linux攻略 关于Apache安装、配置、优化
http://www.henic.com    时间:2007-9-28    河北互联网    关闭窗口

安装 Apache 2.0.48 (查看Install手册)

  考虑到以后要 rewite_url 来使 google 更加容易收录网站,特地添加了 mod_rewrite 。

  同时为了限制流量,特别加了 mod_limitpcnn.c 补丁 , 所以多了一个 --enable-forward 选项。

  建议安装完毕以后不要删除安装目录,以便以后升级时使用。

  记得升级前关闭 apache2.0

  编译过程:
  
  代码:

#./configure --enable-so --enable-speling --enable-rewrite
 --with-ssl=/usr/local/ssl --enable-forward
   # make
   # make install

  这个例子里面是编译了 mod_so,mod_speling 和 openssl 支持。
  同样有另外几种写法
  
  代码:

#./configure --enable-modules=so --enable-modules=speling --enable-modules=rewrite
  
  或者
  
  代码:

#./configure --enable-modules=”so speling”
  
  --enable-MODULE[=shared] 编译并包含模块 MODULE. MODULE 是文档中去掉” _module ”的模块名。要将一个模块编译成为 DSO, 需要加 -shared 选项 , 即 --enable-mods-shared 。 (查看 MODULE 手册)
  
  注意 :"如果希望核心能够装载 DSO,而不实际编译任何动态模块,则要明确指定 --enable-modules=so 或者 --enable-so" (查看 DSO 手册),所以前面的顺序不能交换顺序。 查看所有apache 的 configure 参数
  
  安装完毕后可以用以下命令来查看启动了那些模块
  
  代码:

  # apachectl -l
   Compiled in modules:
   core.c
   mod_access.c
   mod_auth.c
   mod_include.c
   mod_log_config.c
   mod_env.c
   mod_setenvif.c
   prefork.c
   http_core.c
   mod_mime.c
   mod_status.c
   mod_autoindex.c
   mod_asis.c
   mod_cgi.c
   mod_negotiation.c
   mod_dir.c mod_imap.c
   mod_actions.c
   mod_speling.c
   mod_userdir.c
   mod_alias.c
   mod_rewrite.c
   mod_so.c 

  接着,将启动程序放入开机程序中去。 如果要启动 ssl 加密网页,则必须通过手动启动 apache2.0 (参见 ssl 部分 )
  
  代码:

# echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.d/rc.local

  参考:

  代码:

If you want your server to continue running after a system reboot ,
   you should add a call to apachectl to your system startup files (typically rc.local
 or
   a file in an rc.N directory). This will start Apache as root. Before doing this ensure
   that your server is properly configured for
 security and access restrictions. 

  在 profile 里面添加以上的语句来设置路径,使得在 bash 下更容易控制 apachectl, 省去了输入路径的麻烦。 9 7 3 1 2 4 8 :

[1] [2] 下一页

  • 上一篇文章:
  • 下一篇文章:
  •   【相关文章
    Windows环境下的Tomcat + Apache配置
    静态/动态编译在Apache+Php+Mysql的应用
    Apache在服务器windows 2000配置全攻略
    配置Apache服务器并且设置DNS
    Windows 2003安装iis,设置iis
    Linux上Apache+PHP4.0+Sybase的安装文档
    安装调试ASP的环境 ( 设置IIS )
    如果建一个属于自己的论坛?
    下载安装Dreamweaver8

      【热门文章
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     什么是电子邮箱?
     Sleepycat软件公司发布新版本Berkeley DB
     关于加强计算机信息系统国际联网备案管理
     WML语法大全
     Internet X.509 Public Key Infrastructu
     中国互联网络信息中心域名争议解决办法程
     .ORG 后缀域名在线注册
     .COM 后缀域名在线注册
     促进多语言互联网的全球讨论会
     中国国家顶级域名.CN发展大事记

    《中华人民共和国增值电信业务经营许可证》编号:冀B2-20050128
    Copyright © 2004-2008 HENIC.COM All Rights Reserved.
    河北互联网 版权所有 合作联系QQ:52720100