centos中關閉selinux的方法

來源:互聯網
上載者:User

這兩天做LAMP時才發現selinux這麼個東西,發個關閉的方法!

關閉SELinux的方法:

修改/etc/selinux/config檔案中的SELINUX="" 為 disabled ,然後重啟。

如果不想重啟系統,使用命令setenforce 0

註:

setenforce 1 設定SELinux 成為enforcing模式

setenforce 0 設定SELinux 成為permissive模式

在lilo或者grub的啟動參數中增加:selinux=0,也可以關閉selinux

----華麗--------------------------的--------------------------分割線------------------

查看selinux狀態:

/usr/bin/setstatus -v

如下:

SELinux status:                 enabled

SELinuxfs mount:                /selinux

Current mode:                   permissive

Mode from config file:          enforcing

Policy version:                 21

Policy from config file:        targeted

getenforce/setenforce查看和設定SELinux的當前工作模式

----華麗--------------------------的--------------------------分割線------------------

探索服務一啟動,馬上停止,在網上尋找資料,找到安裝時要先禁用SELinux,再安裝MySQL,步驟是:

1. 關閉SELinux,重啟系統;

2. 安裝MySQL(MySQL server應該可以啟動了);

3. 啟用SELinux,重啟系統,之後MySQL server就可以正常啟動了。

啟用禁用SELinux的方法是:

vi /etc/selinux/config(也有人說是/etc/sysconfig/selinux檔案,其實兩個之間是連結關係,隨便改其中一個,另一個也改了)

SELINUX=disable 禁用SeLinux

SELINUX=enforcing 啟用SeLinux

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.