开发者

wsgi + django - permissions for files

开发者 https://www.devze.com 2023-04-03 08:20 出处:网络
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 l

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消