CCL Home Page
Up Directory CCL t011.html
slide

Jan K. Labanowski: "Tomcat, servlets, JSPs and other friends"

Common Gateway Interface

Most popular approach:

  • server receives request to execute a file (e.g., C program or perl script). Server knows that the file should be executed rather than returned, since it is in a special directory or has a special extension.
     
  • server starts a new process (forks a new shell, and runs the file) with parameters given on the command line (the GET method), or sent to the program as STDIN (POST method).
     
  • The program sends output to STDOUT, and this output is sent back to the browser (with the addition of the few response header lines, e.g., Content-Length).
     
  • External program dies/exits, and if it is needed again for the next request, the whole process has to start all over.
     
Very taxing on computer... Each request is like starting a new program.

Modified: Tue Feb 12 20:47:12 2002 GMT
Page accessed 3347 times since Tue Feb 4 17:31:31 2003 GMT