Centos7安裝Apache Http服務器無法訪問如何解決

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



轉:http://blog.csdn.net/u010447234/article/details/63253448

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章