Django应用程序时停止部署在Apache工作(子运行,但失败) [英] Django app stops working when deployed on Apache ( subprocess runs, but fails )

查看:193
本文介绍了Django应用程序时停止部署在Apache工作(子运行,但失败)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Django应用程序停止在Apache部署工作时(与mod_wsgi的)。
它运行在Windows服务器上。在Windows应用程序调用的可执行文件呼吁其上的另一个远程Windows对话框执行命令雷克斯(炼金术远程执行程序)。

My Django app stops working when deployed on Apache ( with mod_wsgi ). It runs on a Windows server. The app calls on a windows executable called "rex" ( Alchemy Remote Executor ) which executes a command on another remote windows box.

process  = subprocess.Popen( ['rex',ip,usr,pwd,command], stdout=subprocess.PIPE, universal_newlines=True )
out, err = process.communicate() 

这一切发展正常,但与mod_wsgi的部署在Apache的时候,这是行不通的!在雷克斯程序仍运行,但它不能做的事情,并给出了以下消息:

This all works fine in development, but when deployed on Apache with mod_wsgi, it doesn't work! The "rex" program still runs, but it fails to do it's thing, and gives the following message:

Failed to execute the program: A specified logon session does not exist. It may already have been terminated.

所以,雷克斯程序正在运行,但它不能使所需的连接或东西,当它来自Apache催生。它似乎像Apache正在以某种方式通过关闭rex.exe做才可以完成连接!

So, the "rex" program is running, but it is not able to make the required connections or something when it's spawned from Apache. It almost seems like Apache is somehow closing the connection made by "rex.exe" before it can finish!

任何想法?

推荐答案

它总是一个挑战,部署到比你下的,当你在开发运行在运行为不同的用户提供窗口服务时,运行它作为一个真正的用户。我有各种麻烦与此编写作为服务运行,获取文件权限问题的更新程序。你可以尝试登录到Windows运行Apache服务相同的用户,并从那里试试你的霸王龙的可执行文件?运气好的话,你也许可以得到,你是互动性和可进行故障排除,雷克斯失败在那里。

It's always a challenge when deploying to a windows service that you are running as a different user than you're running under when you are in development, running it as a real user. I've had all kinds of troubles with this writing an updater that runs as a service, getting file permissions problems. Can you try logging in to Windows as the same user that is running the Apache service, and try your rex executable from there? With luck, you might be able to get rex to fail there where you're interactive and can troubleshoot it.

但基本思路是复制失败的Apache服务之外,然后做相应处理即可让这个东西运行,而根据该服务的权限,你在固定的。这可能是因为你的雷克斯程序试图读取或写入到文件(如配置文件?),它不具有权限。

But the basic idea is to replicate the failure outside of the apache service, then do whatever is needed to let this thing run while under the permissions of the service, and you're fixed. It could be that your rex program is trying to read or write to files (such as configuration files?) that it doesn't have permissions for.

这篇关于Django应用程序时停止部署在Apache工作(子运行,但失败)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆