2012年9月29日 星期六

SELinux 設定初探

昨天在網站上安裝CHC.WebHD 
可是發現很不順
後來發現是SELinux搞的鬼~~

  • 檢查SELinux是否開啟
     $getenforce
    出現Disabled(表示沒有開啟)
    出現Enforcing
    (表示開啟)
  • SELinux開啟的政策查詢
    $ sestatus
    出現
    SELinux status:                 enabled(是否啟動)
    SELinuxfs mount:                /selinux(selinux檔案的掛載點)
    Current mode:                   enforcing(目前模式)
    Mode from config file:          enforcing(設定檔的模式)
    Policy version:                 24
    Policy from config file:        targeted(目前的政策)
  • 查詢檔案的SELinux狀態
    $ls -Z
    出現
    drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 moodle2
    drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 xoops2
    權限:檔案擁有者:檔案群組:身分識別:程序識別:帳號相關身分:檔案名稱
  • 更改安全性
    $chcon -R -t httpd_sys_content_t xoops2
    把XOOPS2這個整資料夾的類型改為httpd_sys_content_t
  • 這樣改一改就可以用了~~

沒有留言:

張貼留言