今天剛裝上FC6,以前可以用的apache日誌配置不能用了,大家幫看看
今天因為硬體問題新裝了FC6,以前用的是FC3,把以前裝的FC3配置好的apache保存日誌格式複製過來,如下:
CustomLog "|/usr/sbin/rotatelogs /etc/httpd/logs/xxx_xxx_com.log.%Y-%m-%d 86400" combined
可是啟動apache的時候發現messages裡面有:
Nov 22 17:37:28 songday kernel: audit(1164235048.515:47): avc: denied { execute } for pid=2232 comm="httpd" name="bash" dev=hda1 ino=256291 scontext=root:system_r:httpd_t:s0 tcontext=system_u:object_r:shell_exec_t:s0 tclass=file
許可權錯誤,apache日誌沒有許可權寫。
我看了下以前FC3的/usr/sbin/rotatelogs執行許可權是:system_u:object_r:sbin_t
現在fc6下卻是:system_u:object_r:httpd_rotatelogs_exec_t
我用audit2allow弄了下messages,返回的是:allow httpd_t shell_exec_t:file execute;
但是這樣改動需要重新編譯selinux,有沒有比較簡便的方法解決這個問題???
《解決方案》
先看一下 fedora 官方 selinux + apache 的 faq。
不會新增 selinux rule 的話,最笨的方式也許就是把 selinux 關閉后比較快.
http://fedora.redhat.com/docs/selinux-apache-fc3/
--
《解決方案》
我看了的,似乎許可權「system_u:object_r:httpd_rotatelogs_exec_t」是新的東西,我把sestatus裡面的httpd_rotatelogs_disable_trans設置為true或false都不好用
但我還是不希望關掉selinux
[ 本帖最後由 songday 於 2006-11-23 15:55 編輯 ]
《解決方案》
請大家幫幫忙啊................