centos7 python3 bottle+nginx+uwsgi搭建

1、依賴python3版本: 安裝python3

yum install python3

2、安裝uwsgi包

yum groupinstall "Development tools"
yum install python3-devel.x86_64
pip3 install uwsgi

  配置uwsgi

[uwsgi]
socket = 127.0.0.1:9000
master = true
workers = 4
chdir = /home/work/***
wsgi-file = ***.py
callable = application
#daemonize = ./uwsgi.log
pidfile = ***.pid
lazy = true
enable-threads = true
buffer-size = 65536

  啓動uwsgi

    uwsgi --ini /path/uwsgi.ini

3、安裝nginx:

 yum install nginx -y

在/etc/nginx/conf.d中增加配置文件uwsgi.conf

 server {

        listen 8080;

        server_name 127.0.0.1;

        location / {

            include uwsgi_params;

            uwsgi_pass 127.0.0.1:9000;

        }

}

6、啓動nginx

service nginx start

官方資料:

https://uwsgi-docs.readthedocs.io/en/latest/WSGIquickstart.html

https://michael.lustfield.net/nginx/bottle-uwsgi-nginx-quickstart

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章