Apache (13) 权限被拒绝:httpd:无法打开错误日志文件无法打开日志

Apache (13) 权限被拒绝:httpd:无法打开错误日志文件无法打开日志,apache,centos,mod-wsgi,wsgi,Apache,Centos,Mod Wsgi,Wsgi,我正在尝试使用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错误日志以确保所有权设置为apache,并使用ls-l ls -l total 0 -rw-r--r--. 1 apache root 0 Ja

我正在尝试使用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错误日志
以确保所有权设置为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]#

问候

将其添加到问题@HimalYou拥有错误的用户组。请尝试
chown apache:apache django错误日志
另外,您可能必须使用
chmod g+w django错误日志
向apache组添加写权限。作为说明,我认为这与SO无关。您应该在serverfaultFor中发布这些类型的问题,以供记录,我遇到了类似的问题。