编译httpd-2.2.22/srclib/apr-util错误的解决方法,本文版权所有风信网 http://www.ithov.com 实测方法。
今天在编译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/访问试试!