CIS4307 - Homeworks 3: A concurrent HTTP Server with CGI

Given: October 14, 2008
Due Date: November 3, 2008, by 10pm

Your homework will consist of two programs:

  1. A modified version of the web server Tiny that I will give to you
  2. A program that will be executed as a CGI request. This program, passed the name of a text file, will produce a page containing the SHA-1 digest of that file.

Here is a pointer to all the code you need for this homework.
The "tiny" web server is minimally modified from http://csapp.cs.cmu.edu. The server fetches pages ONLY from the directory in which it is executing and in directories below it. This server can execute cgi-bin programs. It is very nice and useful code that can give you ideas on socket programming and on HTTP. You are to read and understand little by little all this code.
You are to modify the code provided (mark each of your sections starting with /*vvCIS307xyzvv*/ and ending with /*^^CIS307xyz^^*/) (where c307xyz is your account) as follows:

You will launch your program, if your account is c307214, as follows: lab3 37214 &
where 37214 is the port where your server will wait for requests. From a browser, if your server is moo.cis.temple.edu, you will use urls like

 
   http://moo.cis.temple.edu:37214/home.html
   http://moo.cis.temple.edu:37214/homework3s06.html
   http://moo.cis.temple.edu:37214/cgi-bin/sha1digest?home.html
Processing of cgi-bin requests, as always will involve a fork and an exec call.


Remember to protect all your other files - otherwise they will become readable on the web.

Submit the homework to the blackboard dropbox.