码迷,mamicode.com
首页 > 其他好文 > 详细

centos7 nginx uwsgi falsk

时间:2017-09-13 01:45:21      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:name   head   ase   python   div   rom   oct   root   wan   

1. 安装nginx:

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum install nginx

systemctl start  nginx.service

 

查看nginx 是否启动:

curl http://127.0.0.1

 出现 Welcome to nginx!  nginx 部署成功

<!DOCTYPE html>

<html>

<head>

<title>Welcome to nginx!</title>

2. 安装 falsk :

pip install flask

 vim server.py

# -*- coding: utf-8 -*-

from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello Flask!"

if __name__ == "__main__":
    app.run(host=‘0.0.0.0‘, port=80, debug=True)

 python server.py

[root@izj6c2quobtad98kx7jgtyz ~]# curl http://127.0.0.1
Hello Flask!

 出现 Hello Flask!  成功 

3. 安装 uwsgi:

pip install uwsgi

 vim uwsgi.ini

[uwsgi]
socket = 127.0.0.1:81
pythonpath = /wang/
module = run
callable = app
processes = 1
threads = 1

 未完待续

 

centos7 nginx uwsgi falsk

标签:name   head   ase   python   div   rom   oct   root   wan   

原文地址:http://www.cnblogs.com/dockers/p/7513019.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!