一、uwsgi安装
1、pip安装: pip install uwsgi
2、源码安装:
#wget
http:
//projects
.unbit.it
/downloads/uwsgi-2
.0.11.2.
tar
.gz
#
tar zxf uwsgi-2.0.11.2.tar.gz
# cd uwsgi-2.0.11.2
# python uwsgiconfig.py --build
# uwsgi --version
2.0.11.2
# cp uwsgi /usr/sbin/uwsgi
二、uwsgi启动的方法
1、http、wsgi-file方式
#
Deploy it on HTTP port 9090
uwsgi --http :9090 --wsgi-file foobar.py 9090服务端口,wsgi-file:为foobar.py,里面有application
2、socket方式
uwsgi --socket 127.0.0.1:3031 --wsgi-file foobar.py
3、ini配置文件方式
编写ini配置文件,
#vim foobar.ini
[uwsgi] socket = 127.0.0.1:3031master = true uwsgi --ini-paste ......
4、xml配置文件方式
编写xml配置文件,
#vim foobar.xml
<uwsgi>
<socket>127.0.0.1:3031</socket> <master/></uwsgi>
</uwsgi>
uwsgi -x foobar.xml ....
5、yaml配置文件方式:
根元素需要设置为uwsgi,标识符类型的选项的值可以设为true或者1。
socket选项和master选项可以如下配置:
#vim foobar.yml
uwsgi:
socket: 127.0.0.1
master: 1
uwsgi -y foobar.yml .....
详细说明请看原始文档:http://uwsgi-docs.readthedocs.org/en/latest/
本文出自 “酷比特Linux” 博客,请务必保留此出处http://coolbyte.blog.51cto.com/8289854/1703202
原文:http://coolbyte.blog.51cto.com/8289854/1703202