下载
cd ~
curl -O http://mirrors.shu.edu.cn/apache//apr/apr-1.6.5.tar.gz
2.解压
tar -zxvf apr-1.6.5.tar.gz
3.安装运行
cd apr-1.6.5
./configure --prefix=/usr/local/apr #这个命令的作用是将某文件安装在某地,下同
make && make install
1.下载
cd ~
curl -O http://mirrors.shu.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
2.解压
tar -zxvf apr-util-1.6.1.tar.gz
3.安装运行
cd apr-util
./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr-util
make && make install
这里的第二行代码你可能会遇到这样的错误
/apr_xml.c:35:19: 致命错误:expat.h:没有那个文件或目录
原因是没有安装expat-devel
我们使用yum命令安装上就好了
yum -y expat-devel
1.下载
cd ~
curl -O https://ftp.pcre.org/pub/pcre/pcre-8.00.tar.gz
2.解压
tar -zxvf pcre-8.00.tar.gz
3.安装运行
cd prce-8.00
./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/pcre
make && make install
cd ~
curl - O http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.38.tar.gz
tar -zxvf httpd-2.4.38.tar.gz
cd httpd-2.4.38.tar.gz
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre
cd /usr/local/apache2/bin
./apachectl restart #这个命令时用来重启服务器
与centOS6不同的是centOS7中不再使用iptables,所以关闭的方法是
systemctl stop firewalld
这里贴上一张图片
上图来自 https://blog.csdn.net/c233728461/article/details/52679558