[Python] django部署到apache之后文件上传 [Errno 13] Permission denied

落日映苍穹つ 2022-07-13 06:47 77阅读 0赞



解决方法

修改文件夹uoload用户组为apache的用户组daemon, 属性是 -R 755

  1. [root@VMServer blog]# pwd
  2. /var/www/blog
  3. [root@VMServer fileManage]#ls -ltr
  4. total 24
  5. -rwxr-xr-x 1 root root 252 Mar 22 11:11 manage.py
  6. drwxr-xr-x 6 root root 4096 Mar 22 11:11 static
  7. drwxr-xr-x 2 root root 4096 Mar 22 11:11 templates
  8. drwxr-xr-x 3 root root 4096 Mar 23 08:25 untitled1
  9. drwxr-xr-x 4 root root 4096 Mar 23 09:58 upload
  10. drwxrwxr-x 2 root root 4096 Mar 23 10:06 uoload
  11. [root@VMServer fileManage]# chgrp daemon uoload
  12. [root@VMServer fileManage]# ls -ltr
  13. total 24
  14. -rwxr-xr-x 1 root root 252 Mar 22 11:11 manage.py
  15. drwxr-xr-x 6 root root 4096 Mar 22 11:11 static
  16. drwxr-xr-x 2 root root 4096 Mar 22 11:11 templates
  17. drwxr-xr-x 3 root root 4096 Mar 23 08:25 untitled1
  18. drwxr-xr-x 4 root root 4096 Mar 23 09:58 upload
  19. drwxrwxr-x 2 root daemon 4096 Mar 23 10:06 uoload
  20. [root@VMServer fileManage]#

属性是 755

  1. [root@VMServer fileManage]# chmod g+w uoload

参考

http://blog.sina.com.cn/s/blog_72d1932a0100zyet.html

发表评论

表情:
评论列表 (有 0 条评论,77人围观)

还没有评论,来说两句吧...

相关阅读