18CE005 - Practical 4
18CE005 - Practical 4
PRACTICAL 4
AIM: To create a webserver using EC2 instance in AWS, to host a simple
web page over an EC2 Instance.
THEORY:
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable
compute capacity in the cloud. It is designed to make web-scale cloud computing easier for
developers. Amazon EC2’s simple web service interface allows you to obtain and configure
capacity with minimal friction. It provides you with complete control of your computing
resources and lets you run on Amazon’s proven computing environment.
Amazon EC2 offers the broadest and deepest compute platform with choice of processor,
storage, networking, operating system, and purchase model. We offer the fastest processors in
the cloud and we are the only cloud with 400 Gbps ethernet networking. We have the most
powerful GPU instances for machine learning training and graphics workloads, as well as the
lowest cost-per-inference instances in the cloud. More SAP, HPC, Machine Learning, and
Windows workloads run on AWS than any other cloud. Click here to learn What's New with
Amazon EC2.
Select Free Tier option. For this example, I will be selecting “Amazon Linux 2 AMI
(HVM)”
Next Step is to configure instance. If u have made a free tier account, you will have access to
limited instances. In this case I will be selecting t2 micro instance. Click on “Configure
Instance Details”
CE443 Cloud Computing 18CE005
In the next step, select the option of “Protect against accidental termination”.
Write a script to install httpd to host your website. The script is given below.
#!/bin/bash
yum update -y
yum install httpd -y
service httpd start
chkconfig httpd on
cd /var/www/html
echo "<html><h1>Welcome To My Website! This is simple webpage hosted on
EC2</h1></html>">index.html
CE443 Cloud Computing 18CE005
Select storage.
Proceed without a key pair. Click on Launch instances after tick marking check box.
CE443 Cloud Computing 18CE005
You will be taken to the security groups page. Now you will have to create a new security
group.
Now in case you have already created EC2 instance and are yet to add this particular rule
follow the following steps.
Select your newly created Security Group and remove the default old one.
CE443 Cloud Computing 18CE005