1. 程式人生 > >Centos7.5 安裝Apache 瀏覽器無法訪問解決方法

Centos7.5 安裝Apache 瀏覽器無法訪問解決方法

已測,可以成功連線

 

1. 安裝Apache元件

[[email protected] shell]# yum install httpd

2. 安裝成功後,檢測有無httpd程序

[[email protected] shell]# ps -e |grep httpd

3. 如沒有,啟用該服務

[[email protected] shell]# systemctl restart httpd.service

4. 使用瀏覽器訪問本機IP地址,如果顯示連結失敗如下:


應該是防火牆相關設定問題導致.

5.關閉並禁用防火牆
[

[email protected] shell]# systemctl stop firewalld.service #停止防火牆服務
[[email protected] 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來進行防火牆配置,記得一定要做下面設定:

[[email protected] Desktop]# yum install iptables-services

[[email protected] Desktop]# systemctl enable iptables
---------------------
原文:https://blog.csdn.net/u010447234/article/details/63253448