源码安装Apache,报错:Cannot use an external APR with

之前安装过http的2.2.21,后面换成版本2.2.19,然后就出现apache报错:Cannot use an external APR with the bundled APR-util

源码安装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-util

OK,解决。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/e0ae9f1b4f7079c436fe136a4ba0f509.html