1. 启动
1.1. 前言
wsgi本身也是python写的。
1.2. 配置uwsgi.ini
[uwsgi]
http=127.0.0.1:8000
# current work dir.(absolute path)
chdir=/home/tom/pydemos/django_demos/mysite01
# relative path
wsgi-file=mysite01/wsgi.py
process=2
threads=20
pidfile=uwsgi.pid
# server log ( It should be a relative path.)
daemonize=uwsgi.log
# open master process. one master ==> multiple slaves
master=true
1.3. 启动uwsgi
$ cd xxx
$ sudo uwsgi --ini xxx/uwsgi.ini # 启动 uwsgi
$ sudo uwsgi --stop uwsgi.pid # 启动 uwsgi
启动后,用ps aux | grep uwsgi
查看是否启动。
tom@tpc:~/pydemos/django_demos/mysite01$ ps aux | grep uwsgi
root 103882 0.3 1.9 121336 37104 ? S 11:13