有時候關了防火牆,下次登錄又開了,發現服務起不來,找半天才發現防火牆又開了,真是的,所以建議永久關閉防火牆和selinux
關閉 firewalld:
systemctl stop firewalld #臨時關閉
systemctl disable firewalld #永久關閉,即設置開機的時候不自動啟動
--------------------------------------
關閉 selinux:
[root@localhost html]# getenforce #查看selinux狀態
Permissive
[root@localhost html]# setenforce 0 #臨時關閉
[root@localhost html]# vim /etc/sysconfig/selinux #永久關閉
永久關閉selinux可以使用vi命令打開/etc/sysconfig/selinux 文件將SELINUX=(disable或permissive)
##重啟服務
[root@localhost html]# shutdown -r now (或者reboot簡單粗暴)。
##附
setenforce 1 設置SELinux 成為enforcing模式
setenforce 0 設置SELinux 成為permissive模式