centos编译apahce时出现httpd-2.2.22/srclib/apr-util错误的解决方法

今天在编译apache时,出现如下问题:

make[3]: Entering directory `/tmp/httpd-2.2.22/srclib/apr-util/xml/expat'
/bin/sh ./conftools/mkinstalldirs /usr/local/apache2/lib /usr/local/apache2/include
/bin/sh ./libtool  --mode=install /usr/bin/install -c libexpat.la /usr/local/apache2/lib/libexpat.la
/usr/bin/install -c .libs/libexpat.so.0.5.0 /usr/local/apache2/lib/libexpat.so.0.5.0
(cd /usr/local/apache2/lib && { ln -s -f libexpat.so.0.5.0 libexpat.so.0 || { rm -f libexpat.so.0 && ln -s libexpat.so.0.5.0 libexpat.so.0; }; })
(cd /usr/local/apache2/lib && { ln -s -f libexpat.so.0.5.0 libexpat.so || { rm -f libexpat.so && ln -s libexpat.so.0.5.0 libexpat.so; }; })
/usr/bin/install -c .libs/libexpat.lai /usr/local/apache2/lib/libexpat.la
/usr/bin/install -c .libs/libexpat.a /usr/local/apache2/lib/libexpat.a
chmod 644 /usr/local/apache2/lib/libexpat.a
ranlib /usr/local/apache2/lib/libexpat.a
libtool: install: warning: remember to run `libtool --finish /usr/local/apache2--sysconfdir=/etc/httpd/lib'
/usr/bin/install -c -m 644 ./lib/expat.h /usr/local/apache2/include
make[3]: Leaving directory `/tmp/httpd-2.2.22/srclib/apr-util/xml/expat'
/bin/sh /tmp/httpd-2.2.22/srclib/apr/libtool --mode=install /usr/bin/install -c -m 755 libaprutil-1.la /usr/local/apache2/lib
libtool: install: error: cannot install `libaprutil-1.la' to a directory not ending in /usr/local/apache2--sysconfdir=/etc/httpd/lib
make[2]: *** [install] 错误 1
make[2]: Leaving directory `/tmp/httpd-2.2.22/srclib/apr-util'
make[1]: *** [install-recursive] 错误 1
make[1]: Leaving directory `/tmp/httpd-2.2.22/srclib'
make: *** [install-recursive] 错误 1

卡在这里编译不过去了,分析原因,原来是缺少 apr & apr-util,下面我们就来解决该问题。

需要下载以下两个包:

APR 1.4.5:http://mirror.bjtu.edu.cn/apache//apr/apr-1.4.5.tar.gz
APR-util 1.4.1:http://mirror.bjtu.edu.cn/apache//apr/apr-util-1.4.1.tar.gz

执行以下命令:

    >wget http://mirror.bjtu.edu.cn/apache//apr/apr-1.4.5.tar.gz
  >tar zxvf apr-1.4.5-tar.gz
  >cd apr-1.4.5
  >./configure --prefix=/usr/local/apr-httpd/
  >make
    >make install

    >wget http://mirror.bjtu.edu.cn/apache//apr/apr-util-1.4.1.tar.gz
  >tar zxvf apr-util-1.4.1-tar.gz
  >cd apr-util-1.4.1
  >./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
  >make
    >make install

  回到apache编译目录

  >./configure --prefix=/usr/local/apache2 --sysconfdir=/etc/httpd --with-z=/usr/local/zlib --with-apr=/usr/local/apr-httpd --with-apr-util=/usr/local/apr-util-httpd  --disable-userdir --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support
  >make
  >make install

    启动apache服务

    >/usr/local/apache2/bin/apachectl start

现在可以了,输入http://loaclhost/访问试试!


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值