Changes between Version 1 and Version 2 of Overlap

12/09/10 03:24:54 (8 years ago)



  • Overlap

    v1 v2  
     8== What is SCGI? == 
     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. 
     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. 
     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.). 
     16Here is a cheap diagram: 
     18[web browser] <--http--> [web server] <--scgi--> [app server/cobra] 
     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. 
     22So you can generate dynamic content from Cobra behind Apache and other web servers. 
     24== Sample == 
     26Here are [[sample key value pairs]] of what an SCGI-enable web server passes to the app server. 
     28There is a sample in the repository/workspace that shows how to use the library. 
     30== Configuration == 
     32Here are general steps. Further below under "Web Servers" you may find more detailed instructions. 
     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. 
     39What your browser displays should confirm that the web server passed the request to the app server which returned a response. 
     41== Web Servers == 
     43 * [ Lighttpd] 
     44 * [ Apache] 
     45 * [ Nginx], [ SCGI Module] 
     46 * [ Cherokee] 
     48== References == 
    854== Download == 
    955Find the source code attached below.