Apache2.4以上版本在进行编译时需要安装apr和apr-util两个关键包,否则编译不过去。
下载地址:
apr:http://mirrors.aliyun.com/apache/apr/apr-1.5.2.tar.gz
apr-util:http://mirrors.aliyun.com/apache/apr/apr-util-1.5.4.tar.gz
下载到/usr/local/src下进行解压。
进入到httpd,进行编译Apache:
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre --enable-mods-shared=most --enable-so
问题一:会提示报错如下:
make[2]: *** [exports.lo] Error 1
make[2]: Leaving directory `/usr/local/src/httpd-2.4.7/server'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/httpd-2.4.7/server'
make: *** [all-recursive] Error 1
在./configure后加上--with-include-apr后,
问题二,报错:
configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.
需要将解压后的apr两个包复制到/usr/local/src/httpd-2.4.7/srclib下:
# cp -r apr-1.5.2 /usr/local/src/httpd-2.4.7/srclib/apr
# cp -r apr-util-1.5.4 /usr/local/src/httpd-2.4.7/srclib/apr-util
在进行编译就好了