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

时间:2015-01-10 01:43:02

标签: 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-error-log以确保将所有权设置为apache并使用ls -l

进行验证
ls -l
total 0
-rw-r--r--. 1 apache root 0 Jan 10 01:40 django-error-log

知道是什么导致许可被拒绝了吗?

1 个答案:

答案 0 :(得分:1)

很有可能你有SELinux强制执行。

只需禁用它(SELINUX =已禁用),然后重试。

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]#

此致