centos5.6下 apache2.4.2 安装笔记

先卸载原来安装的apache
yum remove httpd

1、使用 yum 程序安装所需开发包(以下为标准的 RPM 包名称)
yum install gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel libxml2-devel libcurl-devel curl-devel net-snmp-devel
#  这里我们将编译GD所必须的一些小软件比如libpng,libtiff,freetype,libjpeg等先用RPM的方式一并安装好,避免手动编译浪费时间,同时也能避免很多错误,这几个小软件的编译很麻烦。这几个小软件编译错误了,GD当然安装不了,php5的编译当然也没戏了。所以我们抓大放小,对这些小牛鬼蛇神采取快速简洁的方式进行安装。并且对服务器的性能也不能产生什么影响。

2、源码编译安装所需包 (Source)
(1) GD2
cd /usr/local/src
#  tar xzvf gd-2.0.33.tar.gz
#  cd gd-2.0.33
./configure –prefix=/usr/local/gd2 –mandir=/usr/share/man //./configure 配置。
make //make 是用来编译的,它从 Makefile 中读取指令,然后编译。
make install //make install 是用来安装的,它也从 Makefile 中读取指令,安装到指定的位置。
# cd ../

(2) Apache 日志截断程序
cd /usr/local/src
tar xzvf cronolog-1.6.2.tar.gz
cd cronolog-1.6.2
./configure –prefix=/usr/local/cronolog
make
make install
# cd ../

(3) libxml 库程序
cd /usr/local/src
tar zxvf libxml2-2.6.26.tar.gz
#  cd libxml2-2.6.26
#  ./configure –prefix=/usr/local/libxml2
#  make
#  make install
# cd ../

接下来进入正题, 建议安装顺序Mysql,Apache,PHP

tar zxvf httpd-2.4.2.tar.gz
cd httpd-2.4.2

[root@localhost httpd-2.4.2]#  ./configure --prefix=/usr/local/httpd-apache/ --enable-ssl --enable-cgi --enable-mods-shared=allable-ssl --enable-cgi --enable-mods-shared=all --with-ssl=/usr/local/openssl/ --enable-track-vars --enable-rewrite

checking for APR... no
configure: error: APR not found.  Please read the documentation.

下载安装

tar zxvf apr-1.4.6.tar.gz
cd apr-1.4.6
./configure
make && make install

cd ../

继续安装apache

checking for APR-util... no
configure: error: APR-util not found.  Please read the documentation.

下载安装

tar zxvf apr-util-1.4.1.tar.gz
cd apr-util-1.4.1
./configure --with-apr=/usr/local/apr
make && make install
cd ../

继续安装apache

configure: error: pcre-config for libpcre not found. PCRE is required and available from  http://pcre.org/



tar zxvf pcre-8.30.tar.gz
cd pcre-8.30
./configure --with-apr=/usr/local/apr
make && make install
cd ../


再次安装apache
./configure --prefix=/usr/local/httpd-apache/ --enable-ssl --enable-cgi --enable-mods-shared=allable-ssl --enable-cgi --enable-mods-shared=all --with-ssl=/usr/local/openssl/ --enable-track-vars --enable-rewrite

make && make install

cd ../

cd ../httpd-apache

#启动
[root@localhost httpd-apache]# /usr/local/httpd-apache/bin/apachectl start
[root@localhost httpd-apache]#  netstat -utl

#然后打开浏览器,输入“ http://localhost
#出现“It Works!”
至此,安装成功。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值