你好,游客 登录 注册 搜索
背景:
阅读新闻

LNAMP第二版(Nginx 1.2.0+Apache 2.4.2+PHP 5.4)

[日期:2012-05-09] 来源:Linux社区  作者:kerry [字体:大 中 小]

#================= Install apache 2.4.2 ==============#

  1. /usr/sbin/groupadd www  
  2. /usr/sbin/useradd -g www www -s /sbin/nologin  
  3. mkdir -p /data/www/{kerry,king}  
  4. mkdir -p /data/logs/{kerry,king}  
  5. chown -R www:www /data/www  
  6. chown -R www:www /data/logs  
  7. cd /opt  
  8.  
  9. wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz  
  10. rpm -e libtool-1.5.22-7.el5_4  
  11. tar -zxvf libtool-2.4.2.tar.gz  
  12. cd libtool-2.4.2  
  13. ./configure  
  14. make;make install  
  15.  
  16. tar -jxvf pcre-8.30.tar.bz2  
  17. cd pcre-8.30  
  18. ./configure --prefix=/usr/local/pcre  
  19. make;make install  
  20. cd ../  
  21.  
  22. tar -jxvf httpd-2.4.2.tar.bz2  
  23. tar -jxvf httpd-2.4.2-deps.tar.bz2  
  24. cd  httpd-2.4.2 

#隐藏apache版本信息

  1. sed -i 's/#define AP_SERVER_BASEPRODUCT "Apache"/#define AP_SERVER_BASEPRODUCT "Microsoft-IIS 5.0"/' include/ap_release.h  
  2. sed -i 's/#define PLATFORM "Unix"/#define PLATFORM "win32"/' os/unix/os.h 
  1. ./configure --prefix=/usr/local/apache \  
  2. --enable-deflate \  
  3. --enable-headers \  
  4. --enable-mime-magic \  
  5. --enable-proxy \  
  6. --enable-ssl \  
  7. --enable-so \  
  8. --enable-rewrite \  
  9. --enable-suexec \  
  10. --with-suexec-bin=/usr/sbin/suexec \  
  11. --with-suexec-caller=www \  
  12. --with-pcre=/usr/local/pcre/bin/pcre-config \  
  13. --with-mpm=prefork \  
  14. --with-ssl=/usr  
  15.  
  16. make;make install 

#make的时候报错,“/usr/lib/libexpat.so: could not read symbols: File in wrong format”
#解决方法:
\cp /usr/lib64/libexpat.* /usr/lib/

#配置自启动文件
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd
#在首行#!/bin/sh下添加
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /usr/local/apache/logs/httpd.pid
# config: /usr/local/apache/conf/httpd.conf

#或者直接使用sed添加

  1. sed -i '/#!\/bin\/sh/a\# chkconfig: - 85 15\n# description: web server\n# processname: httpd\n# pidfile: /usr/local/apache/logs/httpd.pid\n# config: /usr/local/apache/conf/httpd.conf' /etc/init.d/httpd 
linux
相关资讯       LNAMP 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款