python3
按照常規的方式安裝即可:
wget https://www.python.org/ftp/python/3.5.4/Python-3.5.4.tgz tar zxvf Python-3.5.4.tgz cd Python-3.5.4/ ./configure make -j4 make install
添加環境變量
vim /etc/profile PYTHONPATH=/usr/local/lib/python3.5/bin
修改 yum
的python
vim /usr/bin/yum #!/usr/bin/python -> #!/usr/bin/python2.7
Flask
pip3 install flask
uwsgi
wget https://pypi.python.org/packages/0c/1c/44849e293e367a157f1ad863cee02b4b865840543254d8fae3ecdebdbdb9/uwsgi-2.0.12.tar.gz
我的網頁的路徑為:
/home/APIParse /home/APIParse/htmlWeb.py ...

在當前路徑下新建uwsgiconfig.ini
,寫入如下信息
[uwsgi] # htmlWeb.py文件所在目錄 chdir = /home/APIParse callable = app # flask文件名 wsgi-file= htmlWeb.py # 進程數 processes = 5 # 使用3993端口 http = 0.0.0.0:3993 # 日志輸出目錄 daemonize = /home/APIParse/flask.log pidfile = project-master.pid
完成保存退出,啟動命令並查看進程:
# 啟動命令
uwsgi uwsgi.ini
# 查看進程是否啟動成功
ps -ef | grep uwsgi

如果想要停止uwsgi,就可以殺死所有:
killall -9 uwsgi