Changes

Jump to: navigation, search

OPS705 Lab 4 (2211)

178 bytes added, 00:50, 7 September 2021
m
Chris.johnson moved page OPS705 Lab 4 to OPS705 Lab 4 (2211) without leaving a redirect
== Part 1: Installing the Apache Package ==
# Using SSH, login to your Linux VM. (Remember to check your IP/FQDN, it may change when you start up the VM in AWS.)
# Elevate to the rootaccount: <code> sudo su -</code>
# Install the Apache package with the following command: <code>yum install httpd</code>
# When prompted for confirmation, answer: <code>Y</code>
# To confirm it has installed properly, run the following: <code>yum info httpd</code> The output should include an entry with '''Repo Repository : installed@System'''. If it doesn't say installed, repeat Step 2 or as for assistance.
== Part 2: Managing the httpd (Apache) Service ==
# Finally, check the web server is serving web pages by loading a page locally. Run: <code>curl localhost</code> If you get a bunch of HTML code, you've succeeded! Curl doesn't render HTML code, so you see it as plain text. This is how we check the web server works without dealing with networking.
# Remember from our lecture, there's a difference between ''systemctl start'' and ''systemctl enable''. To ensure the web server starts up with the system every time, run: <code>systemctl enable httpd</code>
# In a browser on your computer, copy Copy and paste the '''Public DNS''' address from the EC2 Instance details page for your Linux VMinto a browser on your computer. It doesn't load, does it? We're not done. Move to '''Investigation 2''' to deal with the firewall.
= INVESTIGATION 2: Configuring Your Linux Firewall =
# Install the ''iptables-services'' package: <code>yum install iptables-services</code>
# Stop the ''firewalld'' service and start the ''iptables'' service in a single, chained command: <code> systemctl stop firewalld; systemctl start iptables</code>(Note: If firewalld isn't present on your system, you'll get a ''not loaded'' error. This is fine. You can move on to Step 4.)
# Check the status of the firewalld service. It should tell you it's stopped.
# Check the status of the iptables service. It should tell you it's '''active'''.
# View your current iptables firewall rules: <code>iptables -nvL --line-numbers</code>
# Refer to ''Figure 1''. If your rules at this stage look different, stop and contact your professor for help.(Packet and byte count numbers will be unique.)
# Set iptables to start with the system: <code>systemctl enable iptables</code>
# Remove ''firewalld'' completely: <code>yum autoremove firewalld</code> '''Note:''' It may not be installed. If it says "no match" when you don't remove firewalld and both firewalls are set to start with run the systemcommand, firewalld will always start instead of iptables. This you can lead to much frustrationmove on. Make sure you remove it!
== Part 2: Securing Your Firewall ==
Finally, let's modify the main page. Currently, it's displaying the default Apache splash page. Let's change that.
# Switch to the root user account.
# Navigate to '''/var/www/html'''. (Refer to ''Lab 3'' for file system navigation tips.)
# List all files in this directory. There are none; this is expected.
Submit to Blackboard full-desktop screenshots (PNG/JPG) of the following:
# Browser window showing the Linux Apache modified HTML page (on your computer, not displayed on your VM).
# SSH session window with your iptables rules listed. (See ''Fig. 1'')

Navigation menu