二维码

Centos7安装Apache Http服务器无法访问如何解决

1599 人阅读 | 时间:2019年10月22日 15:54

1. 安装Apache组件

[root@mycentos shell]# yum install httpd

2. 安装成功后,检测有无httpd进程

[root@mycentos shell]# ps -e |grep httpd

3. 如没有,启用该服务

[root@mycentos shell]# systemctl restart httpd.service

4. 使用浏览器访问本机IP地址,如果显示链接失败如下:

应该是防火墙相关设置问题导致.
5.关闭并禁用防火墙
[root@mycentos shell]# systemctl stop firewalld.service #停止防火墙服务
[root@mycentos Desktop]# systemctl disable firewalld.service #禁用防火墙开机启动服务
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
6.再次访问网站,能够成功登录

注意:如果你还是希望使用iptables来进行防火墙配置,记得一定要做下面设置:

[root@mycentos Desktop]# yum install iptables-services
[root@mycentos Desktop]# systemctl enable iptables


©著作权归作者所有:来自ZhiKuGroup博客作者没文化的原创作品,如需转载,请注明出处,否则将追究法律责任 来源:ZhiKuGroup博客,欢迎分享。

评论专区
  • 昵 称必填
  • 邮 箱选填
  • 网 址选填
◎已有 0 人评论
搜索
作者介绍
30天热门
×
×
本站会员尊享VIP特权,现在就加入我们吧!登录注册×
»
会员登录
新用户注册
×
会员注册
已有账号登录
×