1.编译前安装编译工具及库
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
2.二进制编译安装
下载tar包地址:http://www.apache.org/dist/httpd/
安装编译环境:
点开之后把下载下来的tar包压缩之后放在这里面
3.安装相应包:
yum install apr apr-util apr-devel apr-uti-devel
4.解压文件:
tar xzf httpd-2.4.34.tar.gz
5.预编译的安装目录:
cd httpd-2.4.34
. /configure –prefix=/usr/local/apaache2 –disable-proxy
6.进行:
make && make install
cd /usr/local/apache2
7.启动进程:
/usr/local/apache2/bin/apachectl start
8.查看进程:ps -ef | grep httpd
9.关闭防火墙:
iptables -F
iptables -X
setenforce 0
10.打开网页进行访问(http://IP)