centos7 源码编译安装最新版apache

参考链接:https://blacksaildivision.com/how-to-install-apache-httpd-on-centos

 

1. 安装必要库

yum install epel-release -y

yum install autoconf expat-devel libtool libnghttp2-devel pcre-devel -y

yum install -y openssl-devel //防止缺少一些openssl/*.h

 

2. 下载源码

下载源码
curl -O -L https://github.com/apache/httpd/archive/2.4.33.tar.gz
curl -O -L https://github.com/apache/apr/archive/1.6.3.tar.gz
curl -O -L https://github.com/apache/apr-util/archive/1.6.1.tar.gz

3.编译安装

tar -zxvf 2.4.33.tar.gz
tar -zxvf 1.6.3.tar.gz
tar -zxvf 1.6.1.tar.gz

cp -r apr-1.6.3 httpd-2.4.33/srclib/apr
cp -r apr-util-1.6.1 httpd-2.4.33/srclib/apr-util

cd httpd-2.4.33
./buildconf
./configure --enable-ssl --enable-so --enable-http2 --with-mpm=event --with-included-apr --with-ssl --prefix=/usr/local/apache2
注:确保openssl版本不能太低,可指定安装目录也可以不指定        --with-ssl 或--with-ssl=/usr/local/openssl

make && make install

 

posted @ 2018-04-12 19:38  励志一根草  阅读(392)  评论(0)    收藏  举报