选下载中的第一个
![](https://i-blog.csdnimg.cn/direct/63efbbd945fa464f819243039ff1dd68.png)
选在档案网站上
![](https://i-blog.csdnimg.cn/direct/266f8f03a9894c5a94c01e4b0d94ad2c.png)
Ctrl+F进行搜索
![](https://i-blog.csdnimg.cn/direct/a680e9339c5a41649da661eba4b6ae11.png)
进入 /
usr
/local/
src
下载以下安装包
![](https://i-blog.csdnimg.cn/direct/c6efb0d87abc42c88f3314c811f1a1d2.png)
![](https://i-blog.csdnimg.cn/direct/bd902792d06a4f4fb6ad7545bde7ffd4.png)
![](https://i-blog.csdnimg.cn/direct/75c1e9e365ad48998f542310db4d89c8.png)
![](https://i-blog.csdnimg.cn/direct/089a6ae176f8447088908e6b40939619.png)
安装apr
解压缩
tar -
zxvf
apr-1.7.0.tar.gz
进入
cd apr-1.7.0
/
检查编译环境
./configure --prefix=/
usr
/local/
apr
报错,缺少gcc
编译器,安装
gcc
yum -y install gcc
gcc-c
++
autoconf make
安装 完后继续检查
安装 完后继续检查
./configure --prefix=/usr
/local/
apr
编译安装
make && make install
安装apr-util
解压缩
tar -zxvf
apr-util-1.6.1.tar.gz
进入
cd apr-util-1.6.1/
检查编译环境
./configure --prefix=/usr
/local/
apr-util
--with-
apr
=/
usr
/local/
apr
/bin/apr-1-config
报错,缺少expat
包,安装
expat
包
yum install -y expat-
devel
*
安装完后继续检查
./configure --prefix=/usr
/local/
apr-util
--with-
apr
=/
usr
/local/
apr
/bin/apr-1-
config
编译安装
make && make install
安装pcre
解压缩
tar -zxvf
pcre2-10.39.tar.gz
进入
cd pcre2-10.39
检查编译环境
./configure --prefix=/usr/local/
pcre
编译安装
make && make install
安装httpd
解压缩
tar -zxvf
httpd-2.4.54.tar.gz
进入
cd httpd-2.4.54/
检查编译环境
./configure --prefix=/usr/local/
httpd
--with-
apr
=/
usr
/local/
apr
/bin/apr-1-config --with-
apr
-
util
=/
usr
/local/
apr-util
/bin/apu-1-config --with-
pcre
=/
usr
/local/
pcre
/bin/pcre2-config
编译安装
make && make install
安装完成后设置防火墙
将80
端口配置到
防火墙
firewall-cmd
--zone=public --add-port=80/
tcp
--permanent
重新启动防火墙
firewall-cmd
--reload
启停
HTTPD
服务
/usr
/local/
httpd
/bin/
apachectl
start
配置Apache
cd /
usr
/local/
httpd
/
conf
vim httpd.conf
输入195
按
shift+g
将
s
erverName
localhost:80
粘贴,
:
wq
保存退出
将apr
,
apr-util
,
httpd
重新再运行一遍
apr
cd apr-1.7.0/
./configure --prefix=/
usr
/local/
apr
make && make
install
apr-util
cd apr-util-1.6.1/
./configure --prefix=/usr
/local/
apr-util
--with-
apr
=/
usr
/local/
apr
/bin/apr-1-config
make && make install
httpd
cd httpd-2.4.53/
./configure --prefix=/usr
/local/
httpd
--with-
apr
=/
usr
/local/
apr
/bin/apr-1-config --with-
apr
-
util
=/
usr
/local/
apr-util
/bin/apu-1-config --with-
pcre
=/
usr
/local/
pcre
/bin/pcre2-config
make && make install
然后再启动,启动两次,出现run
就对了
![](https://i-blog.csdnimg.cn/direct/eb49af86174240ca90457042ea453044.png)
![](https://i-blog.csdnimg.cn/direct/03c7187cfc1f48bb843ae6416281b321.png)