WSGI + django - 文件的权限

发布于 2024-12-03 07:47:27 字数 297 浏览 2 评论 0原文

使用 wsgidjango 进行部署时,为了让应用程序运行,文件的权限应该是什么?我已经为其他读取了+执行,但是一旦我删除了对文件的执行权限,似乎领主www-data没有某些权限事物。

You don't have permission to access / on this server.

我尝试为 wsgi 文件添加回 o+x 但似乎徒劳。问题是,哪些文件需要执行权限?

when deploying with wsgi and django, what should be files' permissions in order to get the application running? I've read+execute for others but once i remove execute permission to the files seems like lord www-data does not have permission for some things.

You don't have permission to access / on this server.

I've tried adding back o+x for the wsgi file but seems futile. question is, what are the files requiring execute permission?

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

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

发布评论

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

评论(1

轻许诺言 2024-12-10 07:47:27

据我所知,唯一需要考虑的是从根目录到 server.wsgi 文件的每个目录都必须可由wsgi读取代码 > 容器(例如 Apache 或 uwsgi)。如果您要拥有可写服务,那么您写入的文件或目录必须可由 wsgi 容器进程以及父目录写入。 (这是 sqlite 的一个常见问题 - 包含 sqlite 的目录同样必须可由 wsgi 进程写入。但您没有使用 sqlite。)

了解 wsgi 的内容> 进程以其用户和组状态运行。然后,从该目录中,逐个父目录慢慢退出,在子目录上运行 ls -ld ,并确保该进程可以访问它。

To the best of my knowledge, the only consideration needs to be that every directory from the root to the server.wsgi file must be readable by the wsgi container (such as Apache or uwsgi). If you're going to have writeable services, then the file or directory into which you write must be writeable by the wsgi container process, as well as the parent directory. (This is a common gotcha with sqlite-- the directory which contains sqlite must likewise be writeable by wsgi process. But you're not using sqlite.)

Find out what the wsgi process is running as, both its user and group status. Then, from that directory, slowly back out, parent directory by parent directory, running an ls -ld on the child, and make sure that it is accessible by the process.

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