Giter Site home page Giter Site logo

wsgi_sample's Introduction

wsgi_sample

一个简单的使用paste-deploy、webob、wsgi.py实现wsgi接口和URL分发的样例程序.

依赖(在ubuntu上)

apahce2

libapache2-mod-wsgi

python-pip

routes

webob

paste

pastedeploy

安装

sudo apt-get install apache2 libapache2-mod-wsgi python-pip

sudo pip install routes webob paste pastedeploy

将etc目录下的app_wsgi.conf 文件复制到/etc/apache2/sites-available,并编辑文件:

将APP_PORT替换为要运行的tcp端口

将APP_BIN_PATH 替换为wsgi_sample/app的完全路径.

然后在/etc/apache2/sites-enabled下建立app_wsgi.conf文件的符号链接:

sudo ln -s /etc/apache2/sites-available/app_wsgi.conf /etc/apache2/sites-enabled

重启apache: sudo service apache2 restart

在浏览器中访问ip:port/v1/test可以看到返回的结果

调试

查看/var/log/apache2目录下的error.log日志文件,定位错误信息

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.