OPS245 Assignment 2

From Littlesvr Wiki
Revision as of 19:59, 29 March 2023 by Andrew (talk | contribs) (→‎Submission)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In this assignment you'll practice some of the skills you've learned in the course to build a simple web server. It won't look fancy but you'll only be a couple of steps away from being able to deploy a modern web application.

You will need to figure out how to do some things which you haven't explicitly done before. Figuring it out is part of the work you are expected to do for this assignment.

  • Set up a new Debian virtual machine, call it asg2 and give it the hostname asg2. Do a minimal installtion, with no GUI. All your assignment will be done in this new virtual machine.
    • Make sure the asg2 VM is set up to use LVM.
    • Create a regular user with the same username as your Seneca username.
    • Set it to use the static IP address
  • Add a 1GB drive to the VM.
  • Use the entire drive as a physical volume, add it to the volume group you already have.
  • Create a logical volume named lv_web, formatted as ext4.
  • Set up your system so that lv_web is mounted automatically onto the /var/www directory when the system boos.
  • Install Apache. It will be easier for you if you install it after the lv_web volume is mounted.
  • Configure the workstation so that it will convert the hostname asg2 into the IP address
  • Use Firefox in your workstation VM to confirm that you can see the default webpage on http://asg2
  • Add a second network adapter to the asg2 VM so that you can more easily access it from the host. Make it connect to the host-only network.
  • Check in the Host Network Manager that is an IP address within its range, and it is not in the DHCP pool. You may use a different IP address if this IP address won't fit in your network.
  • Configure the second network interface on asg2 with the static IP
    • Make sure that the network interface is brought up automatically when the VM boots.
  • Use any web browser on the host to confirm that the web server running in asg2 is accesible using
    • Note that you will not be able to use the address on the host because that's not accessible on a NAT Network unless you set up port forwarding.
    • You will also not be able to use the asg2 hostname unless you modify the hosts file in your host machine (you don't need to).
  • Create the directory /var/www/html/photos, and set it to be owned by your regular user.
  • Add a symbolic link /home/yourusername/photos to point to /var/www/html/photos
  • Use any SFTP client you like to connect from your host to asg2 and upload any number of photos to the photos directory.
  • Check that you can access these photos using a web browser on your host machine.


For this assignment please submit screenshots directly to Blackboard. Do not create a document or an archive:

  • 01-lvs.png: Run lvs && blkid
  • 02-mount.png: Run mount | grep web && grep web /etc/fstab
  • 03-systemctl.png: Run systemctl status apache2
  • 04-workstation.png: Firefox in the workstation showing http://asg2
  • 05-network.png: Run ip address && cat /etc/network/interfaces
  • 06-symlink.png: Run ls -ld /home/yourusername/photos
  • 07-photos.png: Firefox on your host showing the photos you uploaded