安装uwsgi nginx 具体方法请百度

1.在项目目录下建立.ini文件

xad_uwsgi.ini

[uwsgi]
master=true
#项目目录
chdir=/root/zhaoyingjie/xadconf
#虚拟环境
virtualenv=/root/zhaoyingjie/pyenv/xadconf
#module=xadserver
#plugins=python
#所需要运行的文件
mount=/=main.py
manage-script-name=true
# TODO
py-autoreload=0
lazy-apps=true
callable=app
#与nginx通信的接口
socket=127.0.0.1:5012 # TODO
#master = true
#所起几个进程
processes=8
#确保文件路径存在 存主进程号
pidfile = /root/zhaoyingjie/xadconf/xadserver_uwsgi.pid
#threads = 2 # threads=2
buffer-size=32768 #确保路径文件在
daemonize = /root/zhaoyingjie/xadconf/uwsgi.log
log-maxsize = 1000000
log-truncate = true
disable-logging = true

2配置nginx文件

在此路径下建立对应文件如果没有请自行创建 xadconf.test.com为二级域名

/etc/nginx/sites-enabled/xadconf.test.com

#xadconf.test.com 内容为
server {
listen 80;
#域名或ip
server_name xadconf.test.com;
#存放log的相对路径
root /data2/output/;
autoindex on;
location /xad_debug {
return 404;
}
location /xad_err_request {
return 404;
}
location /favicon.ico {
return 404;
}
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:5012;
}
#存放log路径
access_log /data2/output/logs/xadconf/access.log;
error_log /data2/output/logs/xadconf/error.log;
disable_symlinks off;
charset utf-8;
}

3.在完成上面配置后,需要按以下步骤来做:重启Nginx服务器,以使Nginx的配置生效。

nginx -s  reload

4.回到项目跟目录启动uwsgi

uwsgi -i XX.ini

5. ps aux | grep uwsgi 检查uwsgi的进程

6.kill -9 进程号  杀死 uwsgi的进程



最新文章

  1. Cesium应用篇:3控件(2)BaseLayerPicker
  2. javascript 伪协议
  3. What is the difference between provider network and self-service network in OpenStack?
  4. Struts1 标签库 说明
  5. 判断浏览器是IE的几种方式
  6. Server-U与IIS端口占用问题解决
  7. find & rm
  8. my_vimrc
  9. Android在ListView滑动数据混乱
  10. 求解释一个蛋疼的bug
  11. group by 多字段分组
  12. SmartAdmin(SmartAdmin_v1.5.2)
  13. C++ 变量的引用 &
  14. dubbo的本地存根(Stub)
  15. 微软Office Online服务安装部署(二)
  16. 011 Spark应用构成结构
  17. angular的组件通信
  18. 20155312 2016-2017-2 《Java程序设计》第十周学习总结
  19. SQLServer 学习笔记之超详细基础SQL语句 Part 5
  20. HihoCoder - 1886 :中位数2(贪心)

热门文章

  1. 【协议篇】TCP
  2. 引入css的几种方式
  3. 【FinacialKnowledge】财务报表及名词解释
  4. spring mvc自定义数据转换
  5. c语言转移符和三字母序列
  6. jQuery正则:电话、身份证、邮箱简单校验
  7. [转载]meclipse中project facet问题
  8. 狄斯奎诺(dijkstra 模板)
  9. Block全面分析
  10. Android 应用开发者必看的 9 个 Tips