Django报错,IOError: [Errno 13]Permission denied
来源:互联网 发布:after effects mac版 编辑:程序博客网 时间:2024/04/29 15:49
django部署环境
apache+mod_wsgi
报错代码
f = open(filename, "w")
分析
打印os.getcwd() # '/'
,得知当前工作目录是根目录,当然没有权限,原因是部署在apache的项目自己不会对工作目录进行初始化,要配置chroot
解决
在/etc/apache2中的具体的wsgi配置文件,增加以下配置即可 WSGIDaemonProcess [project_name] home="xxxx"
<Directory xxxx>
WSGIProcessGroup [project_name]
</Directory>
问题解决参考链接
- http://modwsgi.readthedocs.io/en/latest/configuration-directives/WSGIDaemonProcess.html
- https://stackoverflow.com/questions/12081789/pythons-working-directory-when-running-with-wsgi-and-apache
阅读全文
0 0
- Django报错,IOError: [Errno 13]Permission denied
- python freeline.py 报错 IOError: [Errno 13] Permission denied
- IOError: [Errno 13] Permission denied
- 安装python包时出现IOError: [Errno 13] Permission denied
- nginx+uwsgi+django报错:[Errno 13] Permission denied: ‘/root/.python-eggs’
- nginx+uwsgi+django报错:[Errno 13] Permission denied: ‘/root/.python-eggs’
- 安装第三方包的时候报错 IOError: [Errno 13] Permission denied: 'C:\\Program Files\\Python2.7\\Lib\\site-packages
- 使用pysftp模块或者paramiko模块时出现IOError: [Errno 13] Permission denied: 或IOError: [Errno 2]
- xm:18:<module>:IOError: [Errno 13] Permission denied: '/var/run/xm-deprecation-long-warning'
- caffe-windows 绘制loss accuracy曲线 IOError: [Errno 13] Permission denied: 'aux.txt'错误纠正
- 装完 mysql-python 报错 [Errno 13] Permission denied: '/root/.python-eggs'
- 使用rosmake编译ROS功能包时出错:“IOError: [Errno 13] Permission denied: '/home/xxx/.ros/rosdep/sources.cache/”
- [Errno 13] Permission denied处理
- django部署到apache之后文件上传 [Errno 13] Permission denied
- 解决 “python [Errno 13] Permission denied”
- 解决 “python [Errno 13] Permission denied”
- [Errno 13] Permission denied: '/home/MyGame/cocos2d'
- OSError:[Errno 13]Permission denied解决方法
- keras函数式模型接口
- 2017 Multi-University Training Contest
- Spring boot源码分析-环境搭建
- 你真的愿意主动加班吗
- UTF8编码表
- Django报错,IOError: [Errno 13]Permission denied
- 从0开始写一个基于注解的轻量级分布式RPC框架(3)让Spring加载自定义注解
- HTML、CSS学习
- python 文件操作 UnicodeDecodeError: 'gbk' codec can't decode byte 0xc3 in position 78: invalid continu
- 详解react-native在windows下的环境搭建及存在的那些坑
- 算法系列之归并排序
- jdk安装与环境变量配置,看这篇就够了
- Linux系统nfs服务
- 搜索之倒排索引