1、用yum安装依赖包
yum -y install gcc gcc++ zlib zlib-devel
2、进到下载目录
cd /data/download
3、下载Apache
wget https://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.43.tar.gz
4、解压
tar -zxvf httpd-2.4.43.tar.gz
5、进到httpd目录
cd httpd-2.4.43
6、预编译
./configure --prefix=/data/apache --enable-rewrite --enable-so --enable-headers --enable-expires --with-mpm=worker --enable-modules=most --enable-deflate
7、编译、安装
make && make install
8、复制启动目录到/etc/init.d/目录下
cp /data/apache/bin/apachectl /etc/init.d/httpd
9、启动
/etc/init.d/httpd start
10、查看端口
netstat -lntp|grep 80
11、查看进程
ps -ef |grep httpd