1.得到安装依赖 放在目录 usr/local/src中
wget https://ftp.pcre.org/pub/pcre/pcre-8.01.tar.gz
wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.7.0.tar.gz
wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
2.分别解压
tar zxvf apr-1.7.0.tar.gz
tar zxvf apr-util-1.6.1.tar.gz
tar zxvf pcre-8.01.tar.gz
tar zxvpf httpd-2.4.39.tar.gz //我本地有
3.对包进行分别编译
cd pcre-8.01
./configure --prefix=/opt/pcre
make && make install
cd …/ && cd apr-1.7.0/
./configure --prefix=/opt/apr
make && make install
cd …/ && cd apr-util-1.6.1/
./configure --prefix=/opt/apr-util --with-apr=/opt/apr --with-apr-util=/opt/apr-util --with-pcre=/opt/pcre
make && make install
装的过程发现报错 于是安装
yum install expat-devel
make && make install
cd …/ && cd httpd-2.4.39/
./configure --prefix=/opt/apache --with-apr=/opt/apr --with-apr-util=/opt/apr-util --with-pcre=/opt/pcre --with-included-apr
make -j4 && make install
4.进入apache目录
cd /opt/apache/bin
./httpd
curl localhost:80