Before the app to learn the Webpy, has been used with the webserver, recently studied nginx for some time, decided to play a combination of the two ~
The main points of the building, perhaps one day will have to use-in fact, usually hands are very lazy ...
1 required modules and background knowledge
pcre,flup,nginx,webpy,spawn-fcgi
Pcre is the premise of Nginx installation, after installing Pcre Configur Enginx with--with-pcre=path,path as pcre source path (not the installation path OH).
FASTCGI, the communication specification, specifies the way of communication, the Protocol; WSGI is an interface specification that defines function definitions, calls, and is equivalent to a set of Python APIs that provide support for fastcgi (and other) protocols.
spawn-fcgi, fastcgi process Manager, originally a lighttpd submodule, LIGHTTPD is also an HTTP server similar to Nginx, acting equivalent to the FASTCGI module in other HTTP servers , but it achieves better, in some cases the performance will be relatively high, so they are separated out widely used, so independent out as a project. So there are apache+spawn-fcgi, nginx+spawn-fcgi and so on.
Flup, a Python-written web server, the so-called Server/gateway in CGI, is responsible for accepting LIGHTTPD forwarded requests and invoking the program you wrote (application), and return the results of application processing to APACHE/LIGHTTPD.
web.py, it should be said that with the above things you can start to write your Web program, but the problem is that you have to handle the browser input and output, as well as cookies, sessions, templates and other various problems, Web.py's role is to help you do all this work, it is called the web framework, another famous is Django, but the feeling is too complex, web.py almost enough (currently web.py support for the session is not too good).
Their relationship is as follows,
2 configuration process
See References 2 and 3.
Reference:
1 nginx Configuration Daquan Chinese http://my.oschina.net/duxuefeng/blog/34880
2 WEBPY Official Configuration recommendations HTTP://WEBPY.ORG/COOKBOOK/FASTCGI-NGINX.ZH-CN
31 Examples of Chinese configuration http://blog.csdn.net/five3/article/details/7732832
4 spawn-fcgi Source http://chenzhenianqing.cn/articles/936.html
Nginx+webpy Configuration