service httpd start failed? - Linux

By Caroline
at 2011-01-30T22:34
at 2011-01-30T22:34
Table of Contents
※ 引述《fillmore (.......................)》之銘言:
: 推 bobju:查httpd的log. 01/30 13:33
: → fillmore:error_log是空的 無錯誤 01/30 13:43
: 推 herolee:看系統日志/var/log/messages 01/30 14:32
: → fillmore:/var/log/messages無httpd相關錯誤 01/30 14:45
: 推 ago1414:Options FollowSymlinks 設定加進去看看 01/30 14:57
: httpd相關設定什麼都不用改
: 最後是把SELINUX關掉
: 就正常了
: 不知道牴觸了什麼安全性設定???
應該是你的/home/test/public_html的selinux security context不正確才導致問題
你可以ls -Z 看一下你的/home/test/public_html的security context
可能是
drwxrwxr-x root root root:object_r:user_home_t public_html
security context的格式是Identify:role:type
如果你的type不是httpd_sys_content_t就會被selinux擋住
此時可下chcon -R -t httpd_sys_content_t /home/test/public_html
來改變public_html的context即可
此時就算打開selinux你的httpd也能正常work
原因就出在你是在home dir產生public_html目錄 所以他type是user_home_t
如果直接在/var/www下make dir則type是httpd_sys_content_t就不會有問題
不過理論上selinux應該會在右上角出現黃色星星
然後有warning寫mislabeled然後提示你該如何處理才對
--
: 推 bobju:查httpd的log. 01/30 13:33
: → fillmore:error_log是空的 無錯誤 01/30 13:43
: 推 herolee:看系統日志/var/log/messages 01/30 14:32
: → fillmore:/var/log/messages無httpd相關錯誤 01/30 14:45
: 推 ago1414:Options FollowSymlinks 設定加進去看看 01/30 14:57
: httpd相關設定什麼都不用改
: 最後是把SELINUX關掉
: 就正常了
: 不知道牴觸了什麼安全性設定???
應該是你的/home/test/public_html的selinux security context不正確才導致問題
你可以ls -Z 看一下你的/home/test/public_html的security context
可能是
drwxrwxr-x root root root:object_r:user_home_t public_html
security context的格式是Identify:role:type
如果你的type不是httpd_sys_content_t就會被selinux擋住
此時可下chcon -R -t httpd_sys_content_t /home/test/public_html
來改變public_html的context即可
此時就算打開selinux你的httpd也能正常work
原因就出在你是在home dir產生public_html目錄 所以他type是user_home_t
如果直接在/var/www下make dir則type是httpd_sys_content_t就不會有問題
不過理論上selinux應該會在右上角出現黃色星星
然後有warning寫mislabeled然後提示你該如何處理才對
--
Tags:
Linux
All Comments

By Edith
at 2011-02-03T01:28
at 2011-02-03T01:28

By Jessica
at 2011-02-08T00:58
at 2011-02-08T00:58
Related Posts
service httpd start failed?

By Rae
at 2011-01-30T15:57
at 2011-01-30T15:57
service httpd start failed?

By William
at 2011-01-30T15:34
at 2011-01-30T15:34
service httpd start failed?

By Victoria
at 2011-01-30T13:06
at 2011-01-30T13:06
在linux上建資料庫

By Lydia
at 2011-01-30T12:20
at 2011-01-30T12:20
在linux上建資料庫

By Mia
at 2011-01-30T10:55
at 2011-01-30T10:55