apache - (13) 权限被拒绝 : httpd: could not open error log file Unable to open logs

标签 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

知道是什么导致权限被拒绝吗?

最佳答案

很有可能您有 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/

相关文章:

centos - rpm 规范文件中的问号和感叹号语法

node.js - 重新发布 - 错误 : Ident authentication failed for user

apache - 如何使用通过 wsgi 进程保存的 python 脚本运行终端命令?

python - os.path.expanduser(~) 返回/var/www 而不是/home/ubuntu

apache - 是什么限制了具有大量线程的 Apache 配置的性能?

apache - 使用 base href 时请求 url 问题

c# - 通过 HTTPS 的 HttpWebRequest 的随机问题

作为 Apache CGI 程序运行的 C++ 程序无法通过 shmget 访问共享内存

php - 如何在 NetBeans 的 java web 应用程序项目中运行 php

python - Django、apache 和 mod_wsgi