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.