WSGI + django - 文件的权限
使用 wsgi
和 django
进行部署时,为了让应用程序运行,文件的权限应该是什么?我已经为其他
读取了+执行,但是一旦我删除了对文件的执行权限,似乎领主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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,唯一需要考虑的是从根目录到
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 thewsgi
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 thewsgi
container process, as well as the parent directory. (This is a common gotcha with sqlite-- the directory which contains sqlite must likewise be writeable bywsgi
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 anls -ld
on the child, and make sure that it is accessible by the process.