重度参阅
原理+实战
http://zhou123.blog.51cto.com/4355617/1688434
原理
http://www.cnblogs.com/fnng/p/5268633.html
轻微参阅:
http://www.ziqiangxuetang.com/django/django-nginx-deploy.html
https://github.com/binbin91/oms/blob/master/install.txt
http://binbin158.blog.51cto.com/2659767/1569298
遇到错误:
修改myapp_uwsgi.ini 的运行用户为root
[[email protected] myapp]# pwd /root/d/myapp [[email protected] myapp]# tree . . ├── manage.py ├── myapp │ ├── __init__.py │ ├── __init__.pyc │ ├── settings.py │ ├── settings.pyc │ ├── urls.py │ ├── urls.pyc │ ├── wsgi.py │ └── wsgi.pyc └── myapp_uwsgi.ini
[[email protected] myapp]# pwd
/root/d/myapp
[[email protected] myapp]# cat myapp_uwsgi.ini
[uwsgi] uid = root gid = root chdir = /root/d/myapp module = myapp.wsgi master = true processes = 2 listen = 120 socket = /tmp/myapp.sock pidfile = /var/run/uwsgi.pid vacuum = true enable-threads = true buffer-size = 32768 reload-mercy = 8 max-requests = 5000 limit-as = 256 harakiri = 60 daemonize = /var/log/myapp_uwsgi.log
2,修改socket目录为 /tmp (免去新建test并授权的过程)
3,uwsgi --http :8000 --wsgi-file myapp/wsgi执行错误
uwsgi --http :8000 --wsgi-file myapp/wsgi.py 执行正确
4,看nginx error日志 看下为啥访问不了呢(改了nginx.conf没reload nginx导致)
tail /application/nginx/logs/error.log
5,uwsgi --ini myapp_uwsgi.ini #仅这个命令启动即可
时间: 2024-10-10 14:45:05