Nginx代表root

时间:2015-08-28 14:57:43

标签: nginx

最后,I've succeeded to start nginx 现在,它代表root创建日志文件 那么,有什么想法,为什么它会发生,我该如何解决呢? nginx.conf的第一行是user nginx;

2 个答案:

答案 0 :(得分:1)

所以,我设法解决了这个问题 实际上,解决方案与我prequel question中的解决方案相同:

# put SELinux in permissive mode
setenforce 0
# send USR1 signal to nginx master process
# master process reopens files, does chown() and chmod() to enable
# the worker processes to write to files, and send a notification to
# the worker procesess, so they reopen files instantly
# you can find the path to the nginx pid file in the nginx.conf
kill -USR1 `cat /var/run/nginx.pid`
# create SELinux module
grep nginx /var/log/audit/audit.log | audit2allow -M nginx
# apply module
semodule -i nginx.pp
# put SELinux back in enforcing mode
setenforce 1
# remove SELinux module files
rm -rf nginx.{pp,te}

答案 1 :(得分:0)

问题可能是目录的权限设置不同尝试将日志放在doc root中的某个位置,以便您可以测试它是否是权限问题。用你的发现更新我,我也许可以提供帮助