Lab 2‐2: EC2 Web Server - seabar24/SYS-360 GitHub Wiki

Installing a Web Server on an Instance

First, create a new Instance called Web Server.

Settings:

  • OS: Ubuntu
  • AMI: Ubuntu Server 22.04 LTS (HVM) (Free Tier Eligible)

image

Then, connect to your Instance via SSH KeyPair.

image

From here, install/configure the web server of your choice. For the purposes of this lab, I went with apache2.

For Apache2 install, run the command: sudo apt install apache2.

From there, traverse to /var/www/html and edit the index.html file to make your web page.

After that, do a sudo systemctl reload apache2 and go into a web browser to get to your new web page.

image

Troubleshooting

IF YOU RUN INTO TROUBLE WITH SIGNING IN WITH SSH, MAKE SURE YOU HAVE THE CORRECT USER FOR YOUR AMI. This article helps with troubleshooting

Also, a screenshot of default users for each AMI:

image

Script for doing Passwordless SSH for a new user: Passwordless SSH

A useful guide if you are running into trouble with signing in to your new user using your Key Pair in SSH.

"Please login as the user “ubuntu” rather than the user “root”"