SELinux(Security-Enhanced Linux)安全增強式Linux,是一種強制訪問控制(mandatory access control)的實現。這這種控制下,linux有很多的操作是會被禁止或者是不成功的。之前試過為php配置Oracle支持的時候怎樣都弄不上去。後來把selinux干掉之後就完事了。好了,廢話少說,下面說一下徹底干掉selinux的方法。
vim /etc/selinux/config
打開selinux的配置文件,我們可以看selinux是默認開啟的:
- SELINUX=enforcing
所以我們要修改的就是這個了,把原來的注釋掉,自己寫上
- SELINUX=disabled
具體如下:
- # This file controls the state of SELinux on the system.
- # SELINUX= can take one of these three values:
- # enforcing - SELinux security policy is enforced.
- # permissive - SELinux prints warnings instead of enforcing.
- # disabled - SELinux is fully disabled.
- #SELINUX=enforcing
- SELINUX=disabled
- # SELINUXTYPE= type of policy in use. Possible values are:
- # targeted - Only targeted network daemons are protected.
- # strict - Full SELinux protection.
- SELINUXTYPE=targeted
保存退出,然後重啟一下就ok了。
其實我們可以在裝完系統的時候馬上做好這個處理,以後就不會因一時想不起來而在那糾結了。