天天看點

apache(httpd)

cd /var/www/html        ##apache服務共享檔案的預設目錄##

vim westos.html

            hello world       

[root@apache ~]# systemctl start httpd        ##開啟httpd服務#
[root@apache ~]# systemctl enable httpd.service        ##開機啟動httpd服務##
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
[root@apache ~]# firewall-cmd --list-all        ##檢視火牆的服務狀态##
public (default, active)
  interfaces: eth0
  sources: 
  services: dhcpv6-client ssh
  ports: 
  masquerade: no
  forward-ports: 
  icmp-blocks: 
  rich rules: 
[root@apache ~]# firewall-cmd --permanent --add-service=http        ##永久開啟http服務##
success
[root@apache ~]# firewall-cmd --permanent --add-service=https        ##永久開啟https服務##
success
[root@apache ~]# firewall-cmd --reload         ##重新整理火牆服務狀态##
success
[root@apache ~]# firewall-cmd --list-all
public (default, active)
  interfaces: eth0
  sources: 
  services: dhcpv6-client http https ssh
  ports: 
  masquerade: no
  forward-ports: 
  icmp-blocks: 
  rich rules: