Project 1: Web Server

 

Student Name:  __________________________                  Total Score:              /100

 

Setup for testing

All testing will be on the Unix machine: csil-cpu6.csil.sfu.ca

Use SSH to open two windows to that machine. Download and uncompress the test files.

The web site’s root directory should be structured as follows:

 

% ls -R

.:

archive.zip   index.html   sfu.gif   sfu.jpg   sub

./sub:

sub.html

 

Run your web server in one of the SSH windows on any port (chosen randomly). 

Run a web browser on your local Windows XP  machine.

 

Test cases

 

Replace servername with csil-cpu6.csil.sfu.ca and port with the port number of your server.

 

1. Code quality:                                                   /15  pts

Good structure, sufficient comments, no compilation errors/warnings, readme file.

 

2. Simple request:                                               /15  pts

In the web browser, open  http://servername:port/index.html.

 

2. Simple request in a subdirectory:                  /15  pts

In the web browser, open  http://servername:port/sub/sub.html.

 

3. Object not found:                                            /15  pts

 In the web browser, open  http://servername:port/sub/notexist.html.

 Expected Behavior:  The browser should display an error (“404”) message.

  

4. Basic MIME type handling:                         /15 pts

 In the web browser, open http://servername:port/sfu.jpg.

 In the web browser, open http://servername:port/sfu.gif.

 Expected Behavior: The browser should show the pictures.

 

5. Concurrent requests:                                   /25 pts

This test case downloads 10 copies of archive.zip in parallel. The 10 copies will be stored

as: archive.zip.1, archive.zip.2, ..., archive.zip.10. After all downloads finish, all copies

should have the same size, same as the original archive.zip. To do this, we will use the

Unix command wget.

 

In the second SSH window, create a file named test5 by issuing the command: xemacs test5 &.

Copy the following 10 lines in that file, after replacing servername and port with

their correct values. Then save and close the file.

 

wget http://servername:port/archive.zip -b -O archive.zip.1 &

wget http://servername:port/archive.zip -b -O archive.zip.2 &

wget http://servername:port/archive.zip -b -O archive.zip.3 &

wget http://servername:port/archive.zip -b -O archive.zip.4 &

wget http://servername:port/archive.zip -b -O archive.zip.5 &

wget http://servername:port/archive.zip -b -O archive.zip.6 &

wget http://servername:port/archive.zip -b -O archive.zip.7 &

wget http://servername:port/archive.zip -b -O archive.zip.8 &

wget http://servername:port/archive.zip -b -O archive.zip.9 &

wget http://servername:port/archive.zip -b -O archive.zip.10 &

 

Issue the Unix command: chmod a+x test5

Then, run the test case by issuing:  ./test5