标签:world 127.0.0.1 turn 编译安装 c++ http usr mod read
搭建环境#
yum -y install gcc gcc-c++ zlib zlib-devel openssl openssl-devel pcre pcre-devel GroOP gd libXpm livxslt sqlite-devel
#yum -y install nginx
#systemctl start nginx
#ps -ef |grep nginx
#wget -c https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
#tar -xvf Python-3.6.0.tgz
#cd Python-3.6.0
#./congigure --prefix=/usr/local/python3.6 && make && make install
#ln -s /usr/local/python3.6/bin/python3 /usr/bin/python3
#vim ~/.bash_profile
PATH=$PATH:%HOME/bin:/usr/local/python3.6/bin
python -V
Python 3.6.4
#rm -rf /usr/bin/pip
#ln -s /usr/local/python3.6/bin/pip3.6 /usr/bin/pip
#pip install flask
#mkdir /root/flask_pro
#vim /root/flask_pro/flask_app.py
from flask import Flask,request
app = Flask(__name__)
br/>`@app.route(‘/helloworld/‘)`def helloword()
return ‘helloword‘
if __name__ == ‘_main_‘ :
app.run(host=‘0.0.0.0‘,port=5000)
#python flask_app.py
pip install uwsgi
vim /root/flask_pro/uwsgi.ini
[uwsgi]
socket=127.0.01:5000
chdir=/root/flask_pro/
wsgi-file=flask_app.py
callable=app
processes=2
threads=2
buffer-size=65536
#vim /usr/local/nginx/conf/nginx.conf<br/>
server {<br/>
listen 80;<br/>
server_name www.mdzzzz.cn;<br/>
location / {<br/>
include uwsgi_params;<br/>
uwsgi_pass 127.0.0.1:5000;<br/>
}<br/>
}`
#uwsgi -d --ini /root/flask_pro/uwsgi.ini
#vim /etc/rc.local
uwsgi -d --ini /root/flask_pro/uwsgi.ini
#chmod +x /etc/rc.d/rc.local
#systemctl enable rc-local
#systemctl restart nginx
http://www.mdzzzz,cn/helloworld/
NGINX+UWSGI+PYTHON+FLASK环境搭建——————学习笔记
标签:world 127.0.0.1 turn 编译安装 c++ http usr mod read
原文地址:http://blog.51cto.com/13523939/2068028