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

在ubuntu上使用uwsgi部署CherryPy的应用

时间:2014-08-21 11:28:34      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:uwsgi   cherrypy   python   ubuntu   

1, 安装uWSGI server

sudo apt-get install uwsgi uwsgi-plugin-python
2, 在/etc/uwsgi/apps-available目录下创建配置文件
appsample.json
内容如下
{
    "uwsgi": {
        "chdir": "/home/yourdir",
        "uid": "your-userid",
        "gid": "www-data",
        "workers": 8,
        "module": "appsample:mkapplication()",
        "pythonpath": "/path/to/the/directory/where/yourapp.py/is/found",
        "show-config": true,
        "stats": "127.0.0.1:9191"
    }
}

3, 创建一个link
sudo ln -s /etc/uwsgi/apps-available/appsample.json /etc/uwsgi/apps-enabled/appsample.json
4,restart uwsgi
sudo service uwsgi restart

5,通过如下就可以访问
uwsgi --connect-and-read 127.0.0.1:9191

6,为了便于检测stat server,可以安装
sudo pip install uwsgitop
然后通过uwsgitop检测uwsgi的运行
uwsgitop 127.0.0.1:9191






在ubuntu上使用uwsgi部署CherryPy的应用,布布扣,bubuko.com

在ubuntu上使用uwsgi部署CherryPy的应用

标签:uwsgi   cherrypy   python   ubuntu   

原文地址:http://blog.csdn.net/alexwang1983/article/details/38727199

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