centos6 yum安装的apr版本已经不适用httpd-2.4版本了。所以,需要源码编译apr以及apr-util
1. 下载源码:
cd /usr/local/src/
wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.12.tar.bz2
wget http://mirrors.cnnic.cn/apache/apr/apr-1.5.2.tar.bz2
wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.5.4.tar.gz
2. 安装apr
tar jxvf apr-1.5.2.tar.bz2
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make && make install
3. 安装apr-util
tar zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
make && make install
4. 安装httpd
yum install gcc make cmake pcre-devel
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/
1. 下载源码:
cd /usr/local/src/
wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.12.tar.bz2
wget http://mirrors.cnnic.cn/apache/apr/apr-1.5.2.tar.bz2
wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.5.4.tar.gz
2. 安装apr
tar jxvf apr-1.5.2.tar.bz2
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make && make install
3. 安装apr-util
tar zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
make && make install
4. 安装httpd
yum install gcc make cmake pcre-devel
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/
make && make install
本文转自 小杨_Ivan 51CTO博客,原文链接:http://blog.51cto.com/aqiang/1895595