Network Design, ICS 351, HTTP lab

Instructions for the lab report are italicized.
  1. Configure the http server on PC1 to serve the 3 pages (and the images) which you have created in the prelab. Review each other's html and images and select one person's set to serve.

    Connect PC1 and PC2 to the same hub (or use a crossover cable). Verify that the two are indeed connected.

  2. start the Apache web server on PC1:
    PC1% systemctl start httpd.service
    
    Start wireshark on PC1 and PC2, listening on pseudo-interface "all" (or "any").
  3. Use the default browser on PC1 to load the URL http://10.0.1.11/. If you have configured everything correctly, this should load one of your pages. Otherwise, fix the configuration until you can load the pages, then restart wireshark and load the page.

    Save the wireshark output on PC1

    Examine the packets in wireshark, especially the HTTP request and response headers.

    Answer these questions now and in your lab report:

    How many requests were sent on the first connection? How many replies? Was there only one TCP connection, or more than one? If there was more than one request, what web content was requested by the different requests?

  4. Repeat the previous step (including saving the new wireshark output), but using a different browser if available. Answer the same questions. In addition, both in lab and in your report,

    compare the two request headers (for the main page) and the two response headers, and show the differences between the two.

  5. Finally, repeat the previous two steps but from PC2, then immediately restart wireshark. Then answer the same questions.
  6. In the lab report, describe the meaning of each header line that appears in all four requests or in all four responses. (if only one web browser is available, describe the meaning of each header line that appears in both requests or in both responses.)
  7. Also in the lab report, describe any requests that the browser sent that don't correspond to any actual URL you entered.
  8. Wait until the connection is closed -- you should be able to observe this from wireshark on either PC1 or PC2.

    Save only the packets associated with closing the connection.

    Which side closed the connection? Did any part of the HTTP exchange show that the connection would be closed?

  9. Now from PC2 (any browser) browse all three web pages you created, that is, load the other two web pages.

    1. Does the browser reload the root web page before going to the link you clicked on?
    2. Return to the root web page. Does the browser reload it from the server, or does it use a copy that it cached internally?
    3. If it uses a locally cached copy, reload the page until the page is reloaded from the server (at most 10 times). How many times did you have to reload it for that to happen?
    4. Now shift-reload the page. Did the browser reload the page from the server?
  10. Now load a page that does not exist on your server. Save the HTTP headers, and in your report, show the response header and describe what you can understand from it.
  11. If the links or lynx text-only web browser are available on PC2, use one of them to load and visit all your pages. Compare the requests and responses, and report any noticeable differences in either the request/response patterns or the headers themselves, compared to using the graphical browsers.

    Report what happens if you try and visit one of your image links with the text-only web browser.

  12. On PC2 (re)start wireshark, then telnet to port 80 of PC1:
    PC2% telnet 10.0.1.11 80
    
    Enter (by typing on the keyboard, not with cut-and-paste) the command that you prepared in the prelab. Note that if you are too slow, the server will close the connection.

    Report the command you used, and whether it was effective in loading the page.

    If the command was not effective, change it until you are able to load the page, and report the successful command.

    Then, repeat this after replacing the method GET with HEAD, and report the results.

  13. Start wireshark on PC2, then, using nc on PC2, connect to the server on PC1 and enter the command:
    GET /
    
    followed by an empty line. This may get the root web page using HTTP version 0.9 (which does not explicitly send the HTTP version number). Repeat the operation for your other web pages.

    Save the wireshark output. Report whether the HTTP 0.9 command was effective for each of your web pages. If it was effective, summarize the differences between HTTP/1.1 requests and responses, compared to HTTP 0.9 requests and responses

    Try

    echo 'GET /x.jpg' | nc 10.0.1.11 80 > downloaded.jpg
    
    replacing "x.jpg" with the name of one of your image files.

    Then, open downloaded.jpg to see if the image was downloaded correctly.

  14. Review the configuration file for the apache web server (httpd).

    Discuss any configuration settings that, in your opinion, might be a security issue, and explain why you think this is the case.

  15. Configure your web server to serve your three web pages under 10.0.1.11 but also under the domain names "PC1" and "PC1.lab.net". Make noticeable changes in each of your web pages so you can tell which virtual server it belongs to.

    On PC2, add the domain names "PC1" and "PC1.lab.net" in /etc/hosts, and direct both to point to 10.0.1.11. Use any browser to browse the new web pages in these two virtual sites you have just created.

    Briefly describe the changes you had to make to the Apache configuration, and any files or directories you had to add on PC1, to create one of the virtual servers. If you were not successful in creating a virtual server, describe, as best you can, why you were not successful.