安装nginx python uwsgi环境 以及模拟测试
2016-05-24 14:58
453 查看
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参数,以及各种代理:
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参数,以及各种代理:
相关文章推荐
- 在mac os x 10.9.2上安装nginx
- 简单的nginx一键部署脚本
- Nginx搭建负责均衡
- php和nginx默认上传文件大小限制的解决办法
- mac LaunchRocket图像化管理 php-fpm nginx mysql
- LVS+keepalived+Nginx实现负载均衡时前后端故障全自动化处理
- Nginx配置文件详细说明
- Nginx报错403 forbidden (13: Permission denied)的解决办法
- 分步LVS: 详解利用Keepalived+Nginx解决站点高可用性
- Nginx 之六: Nginx十万并发优化
- nginx平滑升级
- Centos 6.5中Nginx的安装.
- CentOS 7编译安装Nginx1.9.0
- Linux下nginx源码包安装
- Linux操作系统安装nginx
- 转:Nginx+ffmpeg的HLS开源服务器搭建配置及开发详解
- nginx-rtmp-module 指令详解
- nginx上传文件大小
- nginx配置优先级
- Redstone 云观象台 服务器部署 - Nginx配置文件