Networks and Network Security (CS 560)

Project #4 (100 points)


Part 1: Create a simple web server (80 points)

Create a simple Hyper Text Transport Protocol (HTTP) server named shttpd. The server will run on stu at a port of your choice. To test your server I recommend using the Netscape web browser. If your server is listening on port 2130 on stu you should be able to contact your server by entering the following URL in a web browser:

http://stu.cs.jmu.edu:2130/file

          Your server is only required to support the GET method.

Part 2: Support Common Gateway Interface (CGI) scripts (10 points)

This part of the assignment is optional and can earn you up to ten points of extra credit if completed. Make your server capable of handling CGI scripts with arguments. Again, your server should enforce a small bit of security by making sure that it only executes scripts that meet the following minimum criteria:

Part 3: Document your server (20 points)

          stu% ./shttpd 2130
          Server starting, enter URL http://stu.cs.jmu.edu:2130/demo.html in your web browser to see my demo

Your demo should show all of the things that your server can do. You could have a link that says "Click here to view the file foo.html (of type text/html)" and another that says "Click here to view the file elvis.jpg (of type image/jpg)". Your demo should also explain your security mechanisms and show some examples of pages that your program won't serve because they don't meet the security criteria. For example, "Click here to try to view the file restricted.html (it won't work because restricted.html is not world readable)". If you completed part 2,your demo should also run some sample CGI scripts that take arguments and illustrate your security mechanisms for CGI scripts. For example, "Enter text in the two text boxes below and click on 'Submit'. This will run the CGI script test1.sh which prints out the text." Your demo pages and scripts don't have to be designed as described above, but they should clearly demonstrate all of your server's features and capabilities.

Hints:

What is due:

Good luck!