Python Virtualenv,WSGI守护程序erorr。权限被拒绝:mod_wsgi,uid
我检查了一些类似的问题。ex)Python Virtualenv,WSGI守护程序erorr。权限被拒绝:mod_wsgi,uid,python,django,apache,virtualenv,mod-wsgi,Python,Django,Apache,Virtualenv,Mod Wsgi,我检查了一些类似的问题。ex) 但至少我认为它对我的问题不起作用。 我的错误与该链接相同。 (13)权限被拒绝:mod_wsgi(pid=6402):无法以uid=99的用户身份连接到“/etc/httpd/run/wsgi.6399.0.1.sock”上的wsgi守护进程“djangoServer”。 所以我插入了socketuser=#99,但它不起作用用户=#99组=#99也无法解析 系统是Centos7、python2.7.5、apache2.4.6 Virtualenv是djang
但至少我认为它对我的问题不起作用。
我的错误与该链接相同。
(13)权限被拒绝:mod_wsgi(pid=6402):无法以uid=99的用户身份连接到“/etc/httpd/run/wsgi.6399.0.1.sock”上的wsgi守护进程“djangoServer”。
所以我插入了
socketuser=#99
,但它不起作用<代码>用户=#99组=#99也无法解析
系统是Centos7、python2.7.5、apache2.4.6
Virtualenv是django应用程序3.0.3和python 3.6.8 我的django.conf是
# WSGISocketPrefix /var/run/wsgi
<VirtualHost *:80>
DocumentRoot /usr/rest_auth
ServerName djangoServer
WSGIDaemonProcess djangoServer user=#99 group=#99 python-path=/usr/myvenv/lib/python3.6/site-packages
WSGIProcessGroup djangoServer
WSGIScriptAlias / /usr/rest_auth/rest_auth/wsgi.py
<Directory "/usr/rest_auth/rest_auth">
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Alias /assets/ /usr/rest_auth/static/
<Directory /usr/rest_auth/static>
Allow from all
</Directory>
</VirtualHost>
我试图通过这个链接解决它 第一步,我在
apache说,WSGISocketPrefix不能在VirtualHost中使用 因此,我将WSGISocketPrefix移到了VirtualHost之外。
这样,我得到的错误比socket用户多,我认为这是由sqlite版本问题引起的。
这是最后一行错误日志。
django.core.exceptions.impropertlyconfigured:需要SQLite 3.8.3或更高版本(见3.7.17)。
我认为sqlite版本错误是在VirtualHost之外使用WSGISocketPrefix造成的。
我想它忽略了我的环境
如果chmod有问题,您能告诉我应该更改哪个目录吗? 我已经试过一些目录了
感谢阅读我的问题并给出建议。
这是关于堆栈溢出的第一篇文章,我认为编写技术会出错。(我用谷歌翻译…)请理解
import os, sys
from django.core.wsgi import get_wsgi_application
path= os.path.abspath(__file__+'/../..')
if path not in sys.path:
sys.path.append(path)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rest_auth.settings")
application = get_wsgi_application()