apache 编译安装

安装依赖

axel https://mirrors.aliyun.com/apache/apr/apr-1.6.3.tar.gz
axel https://mirrors.aliyun.com/apache/apr/apr-util-1.6.1.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
wget http://www-us.apache.org/dist//httpd/httpd-2.4.34.tar.gz
yum -y install gcc gcc-c++ apr-devel apr-util-devel pcre pcre-devel openssl openssl-devel

解压安装

tar xf apr-1.6.3.tar.gz
cd apr-1.6.3
./configure --prefix=/usr/local/apr
make && make install

tar xf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1
./configure -prefix=/usr/local/apr-util -with-apr=/usr/local/apr
make && make install

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
tar xf pcre-8.40.tar.gz
cd pcre-8.40
./configure -prefix=/usr/local/pcre
make && make install

tar xf httpd-2.4.34.tar.gz
cd httpd-2.4.34

./configure -prefix=/usr/local/apache2 --enable-module=so --enable-mods-shared=all
--enable-deflate --enable-expires --enable-headers --enable-cache --enable-file-cache
--enable-mem-cache --enable-disk-cache --enable-mime-magic --enable-authn-dbm --enable-vhost-alias
--enable-so --enable-rewrite --enable-ssl --with-mpm=prefork -enable-so -enable-rewrite
-with-apr=/usr/local/apr -with-apr-util=/usr/local/apr-util -with-pcre=/usr/local/pcre

make && make install

原文地址:https://www.cnblogs.com/fengmeng1030/p/9342502.html