centos7 nginx uwsgi falsk

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7 nginx uwsgi falsk相关的知识,希望对你有一定的参考价值。

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

[[email protected] ~]# 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的主要内容,如果未能解决你的问题,请参考以下文章

centos7下采用Nginx+uwsgi来部署django

centos7下部署Django(nginx+uWSGI+Python3+Django)

Centos7部署Django+Uwsgi+Nginx环境

阿里云 centos7 django + uWSGI+Nginx + python3 部署攻略

CentOS7.2安装配置nginx+uwsgi+python+flask运行环境

CentOS7下python3+Flask+uWSGI+Nginx+Supervisor环境搭建