Your homework will consist of two programs:
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.htmlProcessing 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.