第一步:下载
wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.39.tar.gz
第二步:解压
tar -xzvf httpd-2.4.39.tar.gz
第三步到httpd-2.4.39
cd httpd-2.4.39
第四步:安装apr接口库和pcre正则表达式库
yum install apr apr-devel apr-util apr-util-devel -y
yum install pcre* -y
第五步:安装Apache路径
./configure --prefix=/usr/local/apache/ --enable-rewrite --enable-so
第六步:预编译和安装Apache
make && make install
第七步:关闭selinux和防火墙
iptables -F
service iptables save
setenforce 0
systemctl stop firewalld.service
第八步:重启Apache
/usr/local/apache/bin/apachectl restart
启动apache警告
没有开启80端口的域名监听,解决方法:
echo “ServerName localhost:80” >> /usr/local/apache/conf/httpd.conf
然后在重启即可
/usr/local/apache/bin/apachectl restart