在mod_wsgi部署的应用程序中拒绝文件写入权限 [英] File writing permission denied in mod_wsgi deployed app
问题描述
我正在尝试在Apache上使用mod_wsgi部署Pyramid应用程序.
I'm trying to deploy a Pyramid app using mod_wsgi on Apache.
即使在我向任何人授予写权限的情况下,mako仍会在模板文件夹中找到IOError: [Errno 13] Permission denied
,.
I get IOError: [Errno 13] Permission denied
on templates folder, where mako caches his templates, even if I grant write permissions to anybody.
如果我从ini文件中删除模板缓存,则该站点将正常运行.
If I remove template caching from my ini file the site runs flawlessly.
我还尝试以拥有该文件夹的用户身份运行Apache,而不是没有运气的www-data
.
I also tried running Apache as the user owning the folder instead of www-data
with no luck.
有任何线索吗?
推荐答案
这是Apache权限问题,
It's an Apache permission issue,
我必须将文件夹所有者更改为www-data
用户,并将权限设置为775
I had to change owner of folder to www-data
user and set permissions to 775
chown -R www-data:www-data ~/data
chmod -R 775 ~/data
也请参阅此处,但对于Mako 664
权限的注意事项还不够
Also see here but note for Mako 664
permissions will not be enough
这篇关于在mod_wsgi部署的应用程序中拒绝文件写入权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!