1.确保已安装gcc: #yum install -y gcc
2.如果报错:error: mod_deflate has been requested but can not be built due to prerequisite failures解决办法:yum install -y zlib-devel
3.在make时报错:解决方法#yum install -y pcre pcre-devel apr apr-devel
4.安装httpd 2.2.29报错:(参照以下方法成功解决,借鉴http://t.cn/RZLKj0w)然后就出现apache报错:Cannot use an external APR with the bundled APR-util一般在第一次源码安装是没有问题的,在版本变化情况下在次源码安装可能会遇到此问题:apache2.0.x与apache2.2.x在apr有很大区别,前者为依赖公用apr,后者依赖于自身的apr。一般前者也就是2.0.x的编译基本上没有apr方面的问题。如果是后者也出现关于apr的问题,则将安装前的apr去除后,在编译apache2.2.x自身的apr,在srclib目录中。
因此根据提示解决此问题:
1、安装APR:[root@web1 httpd-2.2.19]# cd srclib/apr[root@web1 apr]# ./configure --prefix=/usr/local/apr [root@web1 apr]# make && make install
2、安装APR-util[root@web1 httpd-2.2.19]# cd srclib/apr-util[root@web1 httpd-2.2.19]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr[root@web1 httpd-2.2.19]# make && make install
3、安装apache,加入参数(--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util)[root@web1 httpd-2.2.19]# ./configure --prefix=/opt/apache --enable-deflate --enable-expires --enable-headers --enable-modules=most --enable-so --with-mpm=worker --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-utilOK,解决。
本文由 Mr Gu 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为: Aug 26, 2016 at 09:24 pm