Wiki

Changes between Version 1 and Version 2 of Overlap

Show
Ignore:
Timestamp:
12/09/10 03:24:54 (14 years ago)
Author:
todd.a
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Overlap

    v1 v2  
    66 
    77 
     8== What is SCGI? == 
     9 
     10SCGI stands for "Simple Common Gateway Interface". SCGI is a very lightweight and easy to parse protocol that allows any web server with SCGI support to pass requests to a separate program / application server. 
     11 
     12Various web servers such as Apache, lighttpd and nginx have support for SCGI which allows you to have HTTP requests to the web server sent out to a program (which is often called the application server) when then returns a response, ultimately delivered to the web browser. 
     13 
     14The communication is done via a socket and follows a particular protocol. Your program then sends an HTTP response back with headers and content (often <html> ... </html>, CSS, images, etc.). 
     15 
     16Here is a cheap diagram: 
     17 
     18[web browser] <--http--> [web server] <--scgi--> [app server/cobra] 
     19 
     20With the cobra-scgi library, you can easily set up such a program/appserver in Cobra. You write a Cobra method that takes the HTTP request and returns the response as a string. Inside that method, you can do whatever you like. 
     21 
     22So you can generate dynamic content from Cobra behind Apache and other web servers. 
     23 
     24== Sample == 
     25 
     26Here are [[sample key value pairs]] of what an SCGI-enable web server passes to the app server. 
     27 
     28There is a sample in the repository/workspace that shows how to use the library. 
     29 
     30== Configuration == 
     31 
     32Here are general steps. Further below under "Web Servers" you may find more detailed instructions. 
     33 
     34 # Install mod_scgi for your web server if it doesn't have built-in support or does not already have the module. 
     35 # Configure your web server to point a path (such as /scgi or /) to a SCGI server on a port such as 4000 or 8000. 
     36 # Start your SCGI server. You can use the sample program that comes with cobra-scgi to start with. 
     37 # Visit the web server via your browser. 
     38 
     39What your browser displays should confirm that the web server passed the request to the app server which returned a response. 
     40 
     41== Web Servers == 
     42 
     43 * [http://lighttpd.net Lighttpd] 
     44 * [http://httpd.apache.org Apache] 
     45 * [http://nginx.org Nginx], [http://wiki.nginx.org/NginxNgxSCGIModule SCGI Module] 
     46 * [http://www.cherokee-project.com/ Cherokee] 
     47 
     48== References == 
     49 
     50http://python.ca/scgi/protocol.txt 
     51 
     52http://en.wikipedia.org/wiki/Simple_Common_Gateway_Interface 
     53 
    854== Download == 
    955Find the source code attached below.