我正在尝试使用 mod_wsgi 设置 Apache (httpd) 以运行单个 Django 站点。
(13)Permission denied: httpd: could not open error log file /var/mail/django-error-log.
Unable to open logs
我已经完成了:chown apache django-error-log
以确保所有权设置为 apache 并使用 ls -l
进行验证
ls -l
total 0
-rw-r--r--. 1 apache root 0 Jan 10 01:40 django-error-log
知道是什么导致权限被拒绝吗?
最佳答案
很有可能您有 SELinux 强制执行。
只需禁用它 (SELINUX=disabled) 并重试。
1.) vi/etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
2.) 然后“重启”
3.-) 再试一次
可以使用getenforce命令来验证当前状态,如下:
[root@instance-1 selinux]# getenforce
Disabled
[root@instance-1 selinux]#
问候
关于apache - (13) 权限被拒绝 : httpd: could not open error log file Unable to open logs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27871986/