【问题标题】:Apache: Permission denied for directory that has 777 permissionsApache:具有 777 权限的目录的权限被拒绝
【发布时间】:2018-09-07 19:39:46
【问题描述】:

我部署了一个允许上传图像的 Python Flask 应用程序。图片的目录在我的 app 目录中并且有权限

drwxrwxrwx 2 ubuntu   ubuntu    4096 Mar 28 23:22 images

当我提交图片时,我收到以下错误:

[Wed Mar 28 23:49:29.896651 2018] [wsgi:error] [pid 14172:tid 
140055544829696] [client ...]   File "/usr/lib/python2.7/os.py", line 
157, in makedirs, referer: 
http://...compute.amazonaws.com/themes/Birds/paintings/new
[Wed Mar 28 23:49:29.896654 2018] [wsgi:error] [pid 14172:tid 
140055544829696] [client ...]     mkdir(name, mode), referer: 
http://...compute.amazonaws.com/themes/Birds/paintings/new
[Wed Mar 28 23:49:29.896655 2018] [wsgi:error] [pid 14172:tid 
140055544829696] [client ...] OSError: [Errno 13] Permission denied: 
'images', referer: 
http://...compute.amazonaws.com/themes/Birds/paintings/new

我需要配置其他东西才能让它工作吗?

【问题讨论】:

    标签: apache ubuntu permissions file-permissions


    【解决方案1】:

    通过在我的 app.py 文件中设置此目录的完整路径来解决它。

    app.config['UPLOADED_IMAGES_DEST'] = '/home/ubuntu/app/images'
    

    【讨论】: