You are on page 1of 3

AWS Sysops Course

Labs Guide

Sameh Tawfik
Cloud and DevOps Consultant
https://www.linkedin.com/in/sameh-tawfik-consultant/

Sameh Tawfik sameh.tawfk@gmail.com


LAB1: Create an EC2 Instance with httpd service installed
Summary:

Launch an EC2 instance of AWS Linux AMI, install, run httpd service with a simple html webpage and
allow it for public access from anywhere.

Steps:

• Navigate to EC2 Dashboard > Instances.

• Click on Launch Instances.

• On the AMI page, select the Amazon Linux 2 AMI.

• Leave t2.micro selected, and click Next: Configure Instance Details.

• On the Configure Instance Details page:

- Network: default
- Subnet: No preference
- Auto-assign Public IP: Enable

• Click Next: Add Storage, and then click Next: Add Tags.

• On the Add Tags page, click on Add Tag then add the following:

- Key: Name
- Value: Webserver-yourname

• Click Next: Configure Security Group.

• On the Configure Security Group page, click Create a new security group, and set the following
values:

- Security group name: LabSG-yourname


- Description: LabSG

• Click Add Rule, and set the following values (leave the default SSH rule):

- Type: HTTP
- Source: Anywhere

• Click Review and Launch, and then Launch.

• In the key pair dialog, select Create a new key pair.

• Give it a Key pair name: Lab-youname.

Sameh Tawfik sameh.tawfk@gmail.com


• Click Download Key Pair, and then Launch Instances.

• Click View Instances and give it a few minutes to turn into the running state.

• Note the IPv4 public IP of the instance and review the other attributes of the instance.

• Connect to Instance, follow instructions here


https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html

• Install and start httpd service using the below commands

rpm -qa | grep httpd


sudo yum -y install httpd
sudo systemctl start httpd
sudo systemctl enable httpd
sudo systemctl status httpd
sudo vi /var/www/html/index.html

<html>
<body bgcolor="#CC9900">
<h1>Hello World!</h1>
<p>Web Server</p>
</body>
</html>
sudo systemctl restart httpd

• Test the web access to the instance using its public IP address or its DNS name to make sure you
retrieve the HTML page.

Sameh Tawfik sameh.tawfk@gmail.com

You might also like