apache-lab-exercises-go-through-both-exercise-do-what-is-asked-and-record-the-results-in-a-word-document

  • Exercise 1

    1. Edit the Apache config file (or use a .htaccess file) and set the default expiration for cached documents to 1 hour after the document is first accessed. What directives and values did you use for this?

  • 2. Restart Apache and retrieve the ‘index.html’ file at
  • 3. View the response headers ‘Expires’ and ‘Cache-Control’. What values do these headers have? Explain what these values mean.
  • 4. Edit the Apache config file (or use a .htacess file) and set the expiration time for text files to 30 minutes after the document was last modified. Set the expiration time for image files to 1 hour after the file was last accessed. What directives and values did you use for this?
  • 5. Restart Apache and view the response headers after requesting both an image and a text file.What values to you see in ‘Expires’ and ‘Cache-Control’ headers?
  • 6. Modify the text file and request it again. Now what values do you see in these headers? Is this what you expect? Why?
  • Exercise 2

    1. Configure Apache on your local host as a forward proxy server. What directives and values did you use?

  • 2. Configure a browser on a different host to use that Apache proxy server and verify that it works. Make a request to ‘http://apache.org’. Check the log files on your proxy server. Do you see any log entries?
  • 3. Configure your proxy server to block requests to ‘apache.org’ and try again to access it using your browser. Can you access it? What entries do you have in your proxy server log file?