linux下安装uwsgi

2015-07-26  籽藤 

运维同事给了我一台CentOs 6的机器作为测试服务器,我可以自己随便在上面部署测试脚本来玩,终于不用跟sdk组的小伙伴们抢机器了。

=================废话终止分隔符======================

  • 获取uwsgi;目前最新版本是2.0.11.1

wget http://projects.unbit.it/downloads/uwsgi-latest.tar.gz

  • 编译安装;我是用python 2.7.6 编译的

tar zxvf uwsgi-latest.tar.gz

cd uwsgi-2.0.11.1/

python uwsgiconfig.py --build

python setup.py install

  • 测试uwsgi是否正常

新建test.py:

def application(env, start_response): start_response('200 OK', [('Content-Type','text/html')]) return "Hello World"

在终端运行:uwsgi --http :8001 --wsgi-file test.py

通过浏览器访问:http://:8001,看看页面是否有“Hello World”输出。

639°/6395 人阅读/0 条评论 发表评论

登录 后发表评论