Project

General

Profile

Mod scgi » History » Revision 10

Revision 9 (zkv, 2008-11-23 17:17) → Revision 10/17 (Shtirlic, 2009-03-10 16:23)

h1. SCGI Interface 

 {{>toc}} 

 *Module: mod_scgi* 

 h2. Description 

 The SCGI module is heavily based on the FastCGI when it comes to configuration.  

 Only the internal protocol between server and client has been replaced.  

 Please check the documentation of the FastCGI module for more information. 

 h2. History 

 Added in lighttpd 1.3.14 as it was really simple to do. 

 h2. C/C++ SCGI on named socket 

 Up to lightty 1.4.19 there is a bug in that the pre-opened socket handle is not on descriptor 0 (as it is for FastCGI FCGI_LISTENSOCK_FILENO) but any later file descriptor.  

 Since 1.4.20 you can take over your testfastcgi program and replace FCGX_Accept() by a standard Unix accept(LISTENSOCK_FILENO, &addr, &addrlen) - then pthread_create/fork for your handler.  

 The SCGI parameter block at the start of the socket stream is easy to read and to decode - no third-party library is required anymore.  

 Just write() to the accept'ed socket handle to return the result page to the lightty webserver and close() the accept'ed handle to signal that the request has finished.