// 安装编译器
sudo apt-get install build-essential
// 下载所需依赖及apache2源码包
wget --no-check-certificate https://www-eu.apache.org/dist//apr/apr-1.7.0.tar.gz
wget https://www-eu.apache.org/dist//apr/apr-util-1.6.1.tar.gz
wget https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.gz
wget https://sourceforge.net/projects/pcre/files/pcre/8.39/pcre-8.39.tar.gz
wget http://www.openssl.org/source/openssl-1.1.1d.tar.gz
wget https://www-us.apache.org/dist//httpd/httpd-2.4.41.tar.gz
// 解压所有文件
for tar in *.tar.gz; do tar xvf $tar; done
// 安装apr
cd apr-1.7.0
sudo ./configure
错误:rm: cannot remove `libtoolT': No such file or directory
解决:修改configure文件中$RM "$cfgfile"为$RM -f "$cfgfile"
// 安装expat
cd expat-2.2.9
sudo ./configure
// 安装apr-util
cd apr-util-1.6.1
sudo ./configure --with-apr=/usr/local/apr
// 安装pcre
cd pcre-8.39
sudo ./configure
// 安装openssl
cd openssl-1.1.1d
sudo ./config
// 安装apache2
cd httpd-2.4.41
sudo ./configure --enable-so --enable-ssl --with-ssl=/usr/local/ssl --enable-mods-shared=all