安装Apache服务器

这篇博客详细介绍了如何在CentOS系统中安装Apache服务器,包括修改访问端口为9999,并设置防火墙规则。同时,还展示了如何在无法访问默认页面时显示维护信息。
摘要由CSDN通过智能技术生成

1、安装Apache服务器,并配置访问端口为9999
[root@bogon ~]# yum install httpd -y(安装apache,注意要联网)
[root@bogon ~]# yum install httpd-manual
[ root@bogon ~]# systemctl start httpd
[root@bogon ~]# systemctl enable httpd
[rootalocalhost ~]# rpm -ga lgrep httpd(查看安装是否完成)
[root@localhost ~]# firewall-cmd --list-all (列出防火墙信息)
[root@localhost ~]# firewall-cmd --permanent --add-service=http success(永久允许http)
[root@localhost ~1# firewall-cmd --reload (重新加载策略)
rootalocalhost ~]# cd /etc/httpd/conf
[rootalocalhost conf]# ls 
httpd.conf   magic
[root@localhost conf]# vim httpd.conf
进入后将端口改为9999,并保存退出

[root@localhost conf]# firewall-cmd --permanent add-port=9999/tcp (端口加入防火墙)
[rootalocalhost conf]# firewall-cmd --reload 
[rootalocalhost conf]# firewall-cmd --list-all

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值