Linux Lab #9 (50pts)

Due Wednesday June 15

Use the script command to make a log of your activities. The log should be named Lab9.HOSTNAME.DATE where HOSTNAME is your hostname (fetched from an environment variable or inline execution) and DATE is the current date and time in the format MMDDYY (fetched with inline execution). (E.g. "Lab9.LINFORD3040.052305")

In answering direct questions below (as marked by the question-mark '?'), use a shell comment to give your answer. For example, if I say: "What is the command to give you the system time?" You should type, at the command prompt, "# date is the command" or something to that effect. The important part is the hash-mark '#' which causes the shell to ignore everything behind it.

I strongly recommend that you use two terminals: one to run the script command and one to test your commands before executing them under script. It's also a good idea to use shell comments to say which part of the assignment the following commands are for.

Do not run any program which generates lots of escape- and meta-characters inside a terminal running the 'script' command. This includes man, vi, and pico.

Install Apache 1.3 from Source

  1. Make sure you are not root
  2. Copy /public_3040/apache_1.3.33.tar.gz from my laptop to the current user's home directory
  3. Use gunzip to decompress the archive. Notice that the ".gz" is removed from the archive
  4. Use tar to list the archive's contents
  5. Use tar to verbosely extract the archive
  6. Enter the apache source directory
  7. Configure the apache source tree with the following options:
    1. The destination installation directory is /usr/local/apache13
    2. The server will run under UID wwwrun
    3. The server will run under GID www
    4. All modules are enabled by default
    5. Disable the following modules:
      1. auth_db
      2. auth_dbm
  8. Build the source tree
  9. Become root
  10. Set your umask to 022
  11. Install the newly-built apache
  12. Use ln to make a symbolic link from /usr/local/apache13/bin/apachectl to /etc/init.d/apache13

Configure Apache 1.3

  1. Make sure you are root
  2. Change to the configuration directory for the new Apache 1.3 installation
  3. Make a backup copy of the Apache 1.3 configuration file with filename httpd.conf.DATE.bak where DATE is the current date with the format string "+%m%d%y-%H:%M.%S"
  4. Configure Apache 1.3 to...
    1. Listen on port 80
    2. List the administrator's e-mail address as your e-mail address
    3. Alias /home to "userfiles". Why is this a bad thing to do?
  5. Use diff to show your changes

Test Apache 1.3

  1. Start Apache 1.3
  2. View the apache manual
  3. Use the security hole made by aliasing /home to show kenny's personal shell settings
  4. Show the apache access log

When finished, type exit or press ^D until you get a message like "Script done, file is Lab9.HOSTNAME.DATE". To turn in the assignment, scp the logfile to 192.168.0.100:/public_3040 as user "cs3040"