1.删除httpd服务:
[root@ATM ~]# systemctl start httpd
[root@ATM ~]# ps aux | grep httpd
[root@ATM ~]# kill -9 xxxxx (删除)
2.关闭和移动httpd服务:
[root@ATM ~]# systemctl stop httpd
[root@ATM ~]# yum remove httpd
3.编译前安装编译工具及库:
[root@ATM ~]# yum install -y apr* autoconf automake bison bzip2 bzip2* cloog-ppl compat* cpp curl curl-devel fontconfig fontconfig-devel freetype freetype* freetype-devel gcc gcc-c++ gtk+-devel gd gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng libpng-devel libjpeg* libsepol-devel libselinux-devel libstdc++-devel libtool* libgomp libxml2 libxml2-devel libXpm* libtiff libtiff* make mpfr ncurses* ntp openssl openssl-devel patch pcre-devel perl php-common php-gd policycoreutils telnet t1lib t1lib* nasm nasm* wget zlib-devel
4.安装相应包:
[root@ATM ~]# yum install apr apr-util apr-devel apr-util-devel
5.解压文件:
[root@ATM ~]# tar xzf httpd-2.4.34.tar.gz
6.预编译安装目录:
[root@ATM ~]# cd httpd-2.4.34
[root@ATM http-2.4.34]# ./configure --prefix=/usr/local/apach2 --desable-proxy
命令最后结果:
7.进行:
[root@ATM http-2.4.34]# make && make install
命令最后结果:
8.启动服务:
[root@ATM ~]# /usr/local/apache2/bin/apachectl start
9.查看进程:
10.清除防火墙:
[root@ATM ~]#iptables -F
[root@ATM ~]#iptables -X
[root@ATM ~]#setenforce 0
最终结果如下: