部署 mod_wsgi:加载 MySQLdb 模块时出错
我想再次使用 apache + mod_wsgi 部署我的 django 应用程序。我似乎收到此错误 500 消息最初,我被告知我需要最新版本的 MySQLdb。安装后,我收到此错误消息。
Error loading MySQLdb module: /tmp/MySQL_python-1.2.3-py2.4-linux-i686.egg-tmp/_mysql.so: failed to map segment from shared object: Permission denied
我不确定到底是什么问题。我相信这可能与我的httpd.conf中写的这一行有关。
WSGIPythonEggs /tmp
但它是这样设置的,以便它可以读写和读取。执行。
I want to deploy my django app using apache + mod_wsgi again. I seem to be getting this error 500 message Initially, I was told that I need the latest version of MySQLdb. After I had installed, I got this error message.
Error loading MySQLdb module: /tmp/MySQL_python-1.2.3-py2.4-linux-i686.egg-tmp/_mysql.so: failed to map segment from shared object: Permission denied
I am not sure really what the problem is. I believe it might have something to do with this line written in my httpd.conf.
WSGIPythonEggs /tmp
But it is set that that so it can read write & execute.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SELinux 很可能已启用。这个确切的问题记录在 mod_wsgi 文档中。
http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Secure_Variants_Of_UNIX
SELinux is most likely enabled. This exact issue is documented in mod_wsgi documentation.
http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Secure_Variants_Of_UNIX
尝试使用与
/tmp
不同的目录 - 根据这个问题< /a>,它具有 t 权限集,不允许用户删除不属于自己的文件。您仍然需要 WSGIPythonEggs 指令。
更新:根据 Graham Dumpleton 的评论,该指令仅适用于嵌入模式,不适用于守护进程模式。他提供了一个关于修复应用程序权限问题的 wiki 链接,这建议在
mod_wsgi
脚本模块中设置变量,而不是在httpd.conf
中。Try a different directory than
/tmp
- according to this question, it has the t permission set, which disallows users deleting files not their own.And you still need the
WSGIPythonEggs
directive.Update: According to Graham Dumpleton's comment, the directive only works in embedded mode, not daemon mode. He gives a link to his wiki on fixing Application Permission issues, which suggests setting the variable in the
mod_wsgi
script module, nothttpd.conf
.