centos7 安裝 httpd並打開測試頁


systemctl start firewalld.service#啟動firewall
systemctl stop firewalld.service#停止firewall
systemctl disable firewalld.service#禁止firewall開機啟動

systemctl start iptables.service#啟動
systemctl stop iptables.service#停止iptables
systemctl disable iptables.service#禁止iptables開機啟動

安裝命令:yum -yinstall httpd

配置文件默認路徑:/etc/httpd/conf/httpd.conf 

啟動服務命令:systemctl start httpd.service

開機自動啟動:systemctl enable httpd.service

查看狀態:systemctl status httpd.service

查看進程是不是存在:ps -ef | grep httpd

查看端口是不是正在監聽:netstat -lntp

我用的華為雲的服務器,開始因為不熟悉,沒修改安全組策略,沒開放80端口,所以導致一直訪問不到,這個不是防火牆,是雲服務器提供的保護機制,開啟80端口之后就正常了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM