bottle installation for Python in Ubuntu
来源:互联网 发布:外交部无人侦察机淘宝 编辑:程序博客网 时间:2024/05/19 08:42
添加nginx的源:
sudo add-apt-repository ppa:nginx/stable
然后添加uwsgi的源:
admin@lanlv.org:~$ sudo add-apt-repository ppa:uwsgi/release
admin@lanlv.org:~$ sudo apt-get update
admin@lanlv.org:~$ sudo apt-get install uwsgi-python nginx
配置uwsgi
sudo vi /etc/uwsgi-python/apps-enabled/uwsgi.xml
<uwsgi>
<socket>/tmp/uwsgi.sock</socket>
<master/>
<limit-as>512</limit-as>
<processes>8</processes>
<gid>www-data</gid>
<uid>www-data</uid>
<memory-report/>
<vhost/>
<no-site/>
</uwsgi>
配置nginx
admin@lanlv.org:~$ sudo vi /etc/nginx/sites-enabled/default
server {
listen 80;
server_name localhost;
location / {
include uwsgi_params;
uwsgi_pass unix:///tmp/uwsgi.sock;
uwsgi_param UWSGI_PYHOME /var/www/app;
uwsgi_param UWSGI_CHDIR /var/www/app;
uwsgi_param UWSGI_SCRIPT index;
}
}
重启 nginx 和 uwsgi
admin@lanlv.org:~$ sudo /etc/init.d/uwsgi-python restart
admin@lanlv.org:~$ sudo /etc/init.d/nginx restart
安装bottle框架
pip install bottle or easy_install bottle (需要安装python-pip or python-setuptools)
测试 bottle hello world:
import os
from bottle import route, run, default_app
@route('/')
def main():
return "Hello world!"
if __name__ == "__main__":
run()
else:
os.chdir(os.path.dirname(__file__))
application = default_app()
打开浏览器,http://localhost OK?
- bottle installation for Python in Ubuntu
- openvswitch installation in Ubuntu
- openvswitch installation in Ubuntu
- OpenCV installation for Ubuntu 12.04
- RTAI installation for Ubuntu 14.04
- RTAI installation for Ubuntu 14.04
- login loop for ubuntu installation
- Installation steps for python-opencv
- R installation on Ubuntu in details
- installation of necessary packages in ubuntu
- MATLAB R2009b UNIX installation for Ubuntu 10.04
- Installation QT ROS 插件 for Ubuntu 16.04
- netease-cloud-music for ubuntu installation
- no python installation found in the registry
- Eclipse Download and Installation (for Python) Instructions
- Python web frame:Bottle
- python bottle json 返回
- python bottle 简介
- ASM/AAM手工标定的Matlab脚本
- wpf学习笔记补充
- Java知识总结-for循环
- check box 手记
- makefile 的make命令默认只执行第一条命令
- bottle installation for Python in Ubuntu
- ubutun 不能使用这几个转义字符 \c \t \n?解决办法
- RAID
- 什么是REST风格
- Computer cluster
- oracle优化
- /usr/local/vxipnp/linux/bin/libvisa.so.7: wrong ELF class: ELFCLASS32
- eclipse.ini内存设置(转)
- Storage virtualization