Open main menu

CDOT Wiki β

Changes

OPS705 Lab 4

853 bytes added, 18:06, 13 February 2023
Part 2: Editing Your IIS Website
== Part 2: Allowing Web Traffic ==
[[Image:Ops705_lab4_httpd_rules.png|thumb|right|350px400px|Figure 2: New HTTP rule added to our firewall.]]
In this section, you will follow security best practices to allow web server traffic into your VM. We'll open a firewall exception to allow requests to our web server through, so we can access our new web server from the Internet.
== Part 3: Editing Your Apache Website ==
[[Image:Ops705_lab4_linux_html_code.png|thumb|right|300px|Figure 3: Code example of index.html.]]
Finally, modify the main page. Currently, it's displaying the default Apache splash page. Let's change that.
# Navigate to: '''/var/www/html'''
# List all files in this directory. There are none; this is expected.
# Open Elevate to root privileges and open a new vim session for '''index.html''' in this location.
# Using HTML, give it a title of: '''OPS705 Linux Server - Winter 2022'''.
# Using HTML, add to the body: '''Name: yourname'''
== Part 1: Installing and Verifying the IIS Web Server ==
[[Image:Ops705_lab4_iis_artifact.png|thumb|right|300px|Figure 4: Adding the IIS artifact in Azure.]]
# Spin up your Windows Server VM, and wait until it's fully started up.
# In the Azure blade for your Windows Server VM, add and apply the '''Internet Information Services (IIS)''' artifact.
== Part 2: Editing Your IIS Website ==
[[Image:Ops705_lab4_iis_explore.png|thumb|right|300px|Figure 5: Finding the ''Explore'' link in IIS.]]
# First: In a new file explorer window, find the ''View'' menu item near the top, and click ''File name extensions''.
# Next: Open '''Server Manager''' from the Start menu and click on the '''Local Server''' menu bar option.
# In the new window in the ''Connections'' menu column on the left, expand the '''Sites''' folder and click on '''Default Web Site'''.
# In the ''Actions'' menu column on the right, click '''Explore'''. This will open a new folder where your IIS web pages are stored.
# Right-click anywhere in that window, click '''New > Text Document'''. Name it '''index.html'''.Save it with double-quotes to make sure it's saved as an HTML file, not text. <code>"index.html"</code>
# Open the text file, and write the same HTML code as Investigation 1, changing the title tag to: ''OPS705 IIS Web Server - Winter 2022''.
# Refresh your browser page from ''Part 21''. : <code>http://localhost</code> You should see your new code.
# On your host computer, open a browser and navigate to the URL you used to remotely connect to your Windows Server VM. Unlike the Linux Server in Lab 3, the web page you created does not appear. We still have some work to do.
== Part 1: Enabling System-Level Forwarding on Your Linux Server ==
[[Image:Ops705_lab4_ip_forwarding.png|thumb|right|300px|Figure 6: The ''/etc/sysctl.conf'' file with IP forwarding added.]]
# Remote SSH into your Linux Server VM.
# Elevate to root.
== Part 2: Port Forwarding Using NAT ==
[[Image:Ops705_lab4_port_forwarding.png|thumb|right|500px|Figure 7: View of the NAT tables with our port forwarding rules added.]]
# Remote into your Windows Server VM, open Command Prompt, and run <code>ipconfig</code> Write down the 10.x.x.x IP address displayed.
# Remote SSH into your Linux Server VM, and elevate to root.
== Part 3: Adding Forwarding Firewall Rule Exceptions ==
[[Image:Ops705_lab4_forward_rules.png|thumb|right|500px|Figure 8: View of the default tables with our IP forwarding rules added.]]
# Create a firewall rule to allow forwarded traffic destined for TCP port 80: <code>iptables -A FORWARD -p tcp --dport 80 -j ACCEPT</code>
# Create a firewall rule to allow forwarded traffic sent from TCP port 80: <code>iptables -A FORWARD -p tcp --sport 80 -j ACCEPT</code>