如何 chroot Django

发布于 2024-08-26 20:36:27 字数 125 浏览 7 评论 0原文

可以在 chroot 中运行 Django 吗?值得注意的是,为了将(例如)/var/www 设置为 chroot 目录,然后让 Django 在该 chroot 目录中运行,需要什么?

谢谢 - 我很感激您的任何意见。

Can one run Django in a chroot? Notably, what's necessary in order to set up (for example) /var/www as a chroot'd directory and then have Django run in that chroot'd directory?

Thank you - I'm grateful for any input.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不乱于心 2024-09-02 20:36:28

您必须将 Python 解释器添加到该目录,当然还要添加 Django。

设置好环境后,您必须创建一个包装器脚本,该脚本执行类似 os.chroot('/var/www/') 的操作,您就完成了:)

创建Python 的沙盒/chroot 环境尝试以下选项之一: http://wiki.python.org/moin/Asking%20for%20Help/How% 20can%20I%20run%20an%20untrusted%20Python%20script%20safely%20%28即%20Sandbox%29?highlight=%28chroot%29
自从 Google 开始在 App-Engine 中使用 PyPy 选项以来,它似乎越来越受欢迎。

You will have to add a Python interpreter to that directory and add Django to it ofcourse.

After you've got the environment set-up you will have to create a wrapper script that does something like os.chroot('/var/www/') and you're done :)

To create a sandboxed/chrooted environment for Python try one of the following options: http://wiki.python.org/moin/Asking%20for%20Help/How%20can%20I%20run%20an%20untrusted%20Python%20script%20safely%20%28i.e.%20Sandbox%29?highlight=%28chroot%29
The PyPy option seems to be getting popular since Google started using it with the App-Engine.

爱的故事 2024-09-02 20:36:27

mod_wsgi 成为 Python Web 应用部署首选的原因有很多。一是稳定性,二是多种配置选项...其中之一是能够 chroot mod_wsgi 守护进程(从版本 3.00 开始)。

WSGIDaemonProcess 指令的 chroot 选项尚未记录在 http://code 中。 google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess,但 3.0 版中的更改

您还可以在 http://code 阅读该功能的讨论。 google.com/p/modwsgi/issues/detail?id=106

There are many reasons mod_wsgi is preferred for Python web app deployment. One is stability, another is the variety of configuration options... one of which is ability to chroot the mod_wsgi daemon (starting with version 3.00).

The chroot option is not yet documented for the WSGIDaemonProcess directive at http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess but there is enough documentation in Changes in Version 3.0.

You can also read a disussion of the feature at http://code.google.com/p/modwsgi/issues/detail?id=106

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文