安装开发工具包
#yum -y groupinstall "Development Tools" "Server Platform Development"
把之前httpd服务关闭并查看状态是否关闭
#systemctl stop httpd
#systenctl status httpd
编译前安装编译工具及库
#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
安装的两种方式:
#yum安装
#二进制编译安装(下载的地址www.apache.org/dist/httpd/)
安装编译环境
安装相应包:
#yum install apr apr-util apr-devel apr-util-devel
进入目录查看是否下载了包
#cd httpd-2.4.34/
#pwd
解压文件:
#tar xzf httpd-2.4.34.tar.gz
如果是gz2文件:
#tar jxf httpd-2.4.34.tar.bz2
编译安装目录:
# ./configure –prefix=/usr/local/apache2 –disable-proxy(禁止这个模块)
进行
# make && make install
启动服务
#/usr/local/apache2/bin/apachectl start
查看进程
#ps -ef | grep httpd
登陆网址输入IP
原文地址:https://www.cnblogs.com/Zxiaotian/p/9634980.html