概述:
百度一下,基本就知道部署需要安装哪些东西了。部署的整个过程其实不复杂,容易搞不明白的是,配置的路径怎么填写。因为很多帖子写的都是某某 demo 路径,非全路径,按照帖子配置往往跑不起来。
参考帖子:
原理(图片引用于:Nginx+uWSGI+Django原理)

服务运行效果:
nginx 默认的 http 端口是80,搭建服务 ip: 192.168.1.163

uwsgi 部署
工程所在目录
/home/python/xox_server_mgr

uwsgi 命令
启动:uwsgi --ini uwsgi.ini
停止:uwsgi --stop uwsgi.pid
重新加载配置:uwsgi --reload uwsgi.pid


nginx 部署
nginx 相关命令
启动:/etc/init.d/nginx start
停止:/etc/init.d/nginx stop
重新加载配置:nginx -s reload
nginx 配置
/etc/nginx/default.d/default.conf
/etc/nginx/default.d 该目录是 nginx 的子配置目录,如果没有配置文件,得新建一个 *.conf 文件,填充下面内容。


运行
运行 uwsgi:
cd /home/python/xox_server_mgr/xox_server_mgr/
uwsgi --ini uwsgi.ini
错误日志: /home/python/xox_server_mgr/xox_server_mgr/uwsgi.log
运行 nginx:
/etc/init.d/nginx start
错误日志:
根据 nginx.conf 查看错误日志路径,通过该文件查看错误内容。
更精彩内容,请关注我的博客:https://wenfh2020.com
网友评论