热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

mod_wsgi无法连接WSGI守护程序进程-mod_wsgiunabletoconnectWSGIdaemonprocess

IamusingEasyapache4,mod_wsgi,andPython3.5.WhenIcalledaDjangoprojectintheserverIg

I am using Easy apache 4, mod_wsgi, and Python 3.5. When I called a Django project in the server I got the following error:

我正在使用Easy apache 4,mod_wsgi和Python 3.5。当我在服务器中调用Django项目时,我收到以下错误:

(13)Permission denied: mod_wsgi (pid=24223): Unable to connect to WSGI daemon
process 'user123' on '/var/run/wsgi.8442.6.7.sock' as user with uid=3708.

2 个解决方案

#1


4  

Your Apache installation is likely set up to run with SECURE privileges mode. This means that the Apache child worker process is forked and privileges dropped before handling the request, which in this case is simply trying to proxy the request through to the mod_wsgi daemon process. The consequence of this is that it cannot connect to the socket for the daemon process, as it was setup with ownership to match the original Apache child worker process before privileges were dropped.

您的Apache安装可能设置为以SECURE权限模式运行。这意味着在处理请求之前,Apache子工作进程是分叉的并且权限被删除,在这种情况下,这只是尝试将请求代理到mod_wsgi守护进程。这样做的结果是它无法连接到守护进程的套接字,因为它设置了所有权以在删除权限之前匹配原始Apache子工作进程。

This is evident because the error message has uid in the range of a normal user and not the special apache or nobody user.

这是显而易见的,因为错误消息的uid在普通用户的范围内,而不是特殊的apache或nobody用户。

To fix it, you need to modify the WSGIDaemonProcess directive configuration and add the option:

要修复它,您需要修改WSGIDaemonProcess指令配置并添加选项:

socket-user=#3708

or:

socket-user=username

where username is replaced with the actual name of the user with uid of 3708.

其中username替换为uid为3708的用户的实际名称。

The addition of this option seems to be required due to recent changes in CPanel configurations for Apache.

由于最近Apache的CPanel配置发生了变化,因此似乎需要添加此选项。

#2


0  

Sometime socket-user setting does not work. This may occur because of WSGISocketPrefix path not found

有时套接字用户设置不起作用。由于找不到WSGISocketPrefix路径,可能会发生这种情况

  • If it is VPS:

    如果是VPS:

    WSGISocketPrefix /var/run/wsgi

  • If you are in a shared hosting:

    如果您在共享主机中:

    WSGISocketPrefix ../../var/run/wsgi

Thank You


推荐阅读
author-avatar
梦露的殇_192
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有