[[cgi]]
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cgi [2008/12/30 16:33]
LtWorf command line
cgi [2010/05/31 16:03] (current)
LtWorf
Line 1: Line 1:
 This page describes how weborf implements the [[ http://www.ietf.org/rfc/rfc3875 |rfc3875: cgi ]]. This page describes how weborf implements the [[ http://www.ietf.org/rfc/rfc3875 |rfc3875: cgi ]].
 Every difference existing from the rfc in the real implementation must be considered a bug and can be reported. Every difference existing from the rfc in the real implementation must be considered a bug and can be reported.
 +
 +===== CGI script =====
 +Weborf will associate an executable file to each file extension (for example .cgi) and will execute that binary file, that will have to handle the execution of the appropriate script, using some environmental variables.
 +
 +If you want to execute .cgi files, the default installation provides a wrapper for them, so it is possible to execute:
 +<code bash>weborf -c .cgi,/usr/lib/cgi-bin/weborf_cgi_wrapper</code>
 +
 +The wrapper will just execute the cgi script, it will not provide any error reporting.
  
 ===== Timeout ===== ===== Timeout =====
Line 10: Line 18:
 Php has a timeout setting in php.ini but looks like php-cgi ignores it. So don't rely on this setting. Php has a timeout setting in php.ini but looks like php-cgi ignores it. So don't rely on this setting.
  
-===== Standard input ===== 
- 
- 
-===== Standard output ===== 
-The script must send to its standard output an header terminating with ''\r\n\r\n'', eventually followed by a page. 
-If no header information is found in the output, weborf will send to the client an error 500: Internal server error. 
- 
-By default weborf will use code 200 in responses, but the script can override that using the **Status** header. 
- 
-Weborf will split the headers from the content and generate the Content-Length header using the content's size. 
-==== Size ==== 
-Maximum size of the output is defined by: MAXSCRIPTOUT+HEADBUF in [[configuration]]. It is not possible to send 
-to the client a generated page larger than this value. 
-A workaround is to generate the content and save it in a file, and then redirect the client to that file. 
- 
-===== Standard error ===== 
 ===== Enviromental variables ===== ===== Enviromental variables =====
 Weborf will delete all the environmental variables and set only the following ones, so ''export'' used before executing weborf will have no effect. Weborf will delete all the environmental variables and set only the following ones, so ''export'' used before executing weborf will have no effect.
- 
  
   * SERVER_PORT: Port the client connected to.   * SERVER_PORT: Port the client connected to.
cgi.txt · Last modified: 2010/05/31 16:03 by LtWorf
 
Recent changes RSS feed Valid XHTML 1.0 Valid CSS Driven by DokuWiki