CentOS编译安装Apache 2.4.x时报错:configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.

时间:2023-07-15 21:54:30
CentOS编译安装Apache 2.4.x时报错:configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.

先前按照这篇文章“CentOS6.x编译安装LAMP(2):编译安装 Apache2.2.22”去编译安装Apache2.2.x版本时,安装得挺顺利,今天换成Apache2.4.x版本,安装方法一样,在执行./configure命令时,却报如下错误:

configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.

它的意思是说:需要下载apr和apr-utils并解压到 ./srclib/ 目录下, 再进行编译。

cd /usr/local/src  #源码包统一放到此目录
wget -c http://apache.etoak.com/apr/apr-util-1.4.1.tar.gz
wget -c http://apache.etoak.com/apr/apr-1.4.6.tar.gz tar -xzvf ./apr-1.4.6.tar.gz
tar -xzvf ./apr-utli-1.4.1.tar.gz
cp -rf ./apr-1.4.6 ./httpd-2.4.6/srclib/apr
cp -rf ./apr-util-1.4.6 ./httpd-2.4.6/srclib/apr-util

#重新执行 configure 命令:

其他的安装步骤,跟这篇文章“CentOS6.x编译安装LAMP(2):编译安装 Apache2.2.22”类似!


apache-2.2与新出的apache-2.4安装不同的地方在于,2.4版的已经不自带apr库,所以在安装apache-2.4之前,需要下载apr。