httpd

 HTTPD Lab


In this lab you will implement a fairly complete httpd. You will need to have the netscape browser connect to your httpd and will be able to transfer files across the network.

This tutorial should help you in getting your httpd working.  You might also want to look at some cgi documentation.

You will probably want to fork off a child or thread to handle each http session. This will allow several clients to access files at the same time.

You can test using the following files:

You should be able to access them by putting a url that looks something like

 http://flute.cs.byu.edu:1236/students/cs460ta/public_html/test1.html

In this example I am running the server on flute at port 1236 and am trying to access the file in the directory /students/cs460ta/public_html/test1.html.  You can put the files in any location, but you must be able to access them from a normal browser (netscape or ie). If the file does not exist, or if you get any other error, you should construct an appropriate error page and send it back.  If the file is a directory, you should first look to see if there is an index.html file in the directory.  If so, you send it back, if not, you should produce a listing of the files in the directory, format it with a html header and trailer and then send that page back to the browser.

  • YOUR HTTPD SHOULD ALSO BE ABLE TO SHOW A DIRECTORY LISTING!

    http://flute.cs.byu.edu:1236/students/cs460ta/public_html/cgi-bin/test5.cgi

    http://flute.cs.byu.edu:1236/students/cs460ta/public_html/cgi-bin/test6.cgi?teststring

    The following passoff levels will apply to this lab:

    Passoff Level

    Behavior

    Points

    Minimal Passoff

    You can send the basic html, txt, gif, jpg files

    4 Points

    Basic CGI

    You can run test5.cgi

    3 Points

    Perfect behavior

    You can also pass environment variables to test6.cgi and list the contents of a directory if specified

    3 Points