zoukankan      html  css  js  c++  java
  • 安装nginx python uwsgi环境 以及模拟测试

    uwsgi帮助文档:

    http://uwsgi-docs-cn.readthedocs.io/zh_CN/latest/WSGIquickstart.html

    http://uwsgi-docs.readthedocs.io/en/latest/Async.html

    http://www.cnblogs.com/xiongpq/p/3381069.html

    ./configure: error: the HTTP rewrite module requires the PCRE library错误见下文

    http://blog.csdn.net/hfsu0419/article/details/7190152

    也可以参考廖雪峰的博客:

    http://www.liaoxuefeng.com/article/001373892270040b645f6f886d94bdfbf57b8dd596f19b3000

    uwsgi.ini中必须配置

    py-autoreload = 1

    否则程序修改不会生效,见文章:http://stackoverflow.com/questions/27813166/uwsgi-does-not-reload-after-changing-django-settings

    手动命令启动uwsgi:

    [root@crz_oa webserver]# uwsgi --http :9090 --wsgi-file home.py --daemonize /var/log/uwsgi.log

    升级

    [root@crz_oa webserver]# uwsgi --http :9090 --wsgi-file home.py --daemonize /var/log/uwsgi.log --master --harakiri 60 --socket-timeout 10

    或者

    [root@crz_oa webserver]# uwsgi -s 127.0.0.1:9090 --wsgi-file home.py --daemonize /var/log/uwsgi.log --master --harakiri 60 --socket-timeout 10

    然后结合nginx通过socket接口调用

    版本2 结合flask使用命令:

    [root@crz_oa webserver]# uwsgi --http :9090 --wsgi-file home.py --daemonize /var/log/uwsgi.log --master --harakiri 60 --socket-timeout 10 -w home:app

    参考http://docs.jinkan.org/docs/flask/deploying/uwsgi.html

    如果出现错误:

    uwsgi: option '--http' is ambiguous

    换成这种写法

    uwsgi --http-socket :9090 --wsgi-file home.py --daemonize /var/log/uwsgi.log --master --harakiri 60 --socket-timeout 10 -w home:app

    囧,接着又出现错误:

    uwsgi: unrecognized option '--wsgi-file'

    sudo uwsgi --http-socket :9090 --plugin python  --wsgi-file home.py --daemonize /var/log/uwsgi.log --master --harakiri 60 --socket-timeout 10 -w home:app

    模拟测试可以去这个网站http://coolaf.com/,不仅可以模拟post提交,还可以添加各种cookie参数和header参数,以及各种代理:

  • 相关阅读:
    【AS3代码】小游戏打飞机源代码
    【AS3代码】键盘的输入和输出
    PHP多维数组排序
    【AS3代码】一个完整的游戏框架
    【AS3代码】小画板升级版(带重绘回放和清空功能)
    Liunx命令工作总结(1)
    Java NIO基础 我们到底能走多远系列(17)
    ibatis 一对多 解决方案
    图片上传+预览+剪切解决方案我们到底能走多远系列(20)
    Liunx命令工作总结(2)
  • 原文地址:https://www.cnblogs.com/zl0372/p/nginx_python.html
Copyright © 2011-2022 走看看