CC Assignment 4
Report: Deploying a Webpage on a Cloud
Compute Instance (AWS EC2)
1. Introduction
This document details the process of deploying a basic static webpage on an
Ubuntu instance using Amazon EC2. The process involves configuring network
security, launching a virtual machine, installing a web server, and publishing a
simple webpage accessible via a public IP address.
2. Prerequisites
An active Amazon Web Services (AWS) account.
Basic understanding of the AWS Management Console and Linux command-
line interface.
3. Step-by-Step Deployment Process
3.1. Configure Network Security: Security Groups
Before launching the instance, a Security Group must be configured to act as a
virtual firewall. This ensures that only authorized traffic can reach the server.
In the AWS Management Console, navigate to the EC2 dashboard.
Under the "Network & Security" section, select Security Groups.
Click Create security group.
Inbound Rules: Add rules to allow incoming traffic for the following services:
SSH (Port 22): This is essential for connecting to the instance via a
terminal.
HTTP (Port 80): This allows web traffic to reach the webpage.
CC Assignment 4 1
Outbound Rules: The default rule allows all outbound traffic ( [Link]/0 ), which
is suitable for this project.
3.2. Launch the EC2 Instance
With the security group ready, the next step is to launch a virtual server
(instance).
From the EC2 dashboard, select Instances and click Launch Instances.
Name and Tags: Provide a descriptive name for your instance (e.g., Web-Server-
Ubuntu ).
CC Assignment 4 2
Application and OS Images (AMI): Choose an appropriate image. For this
project, Ubuntu Server 22.04 LTS was selected.
Instance Type: Select a suitable instance size. The [Link] or [Link] instance
is ideal for a simple webpage, as it falls under the AWS Free Tier.
CC Assignment 4 3
Key pair (login): Select an existing key pair or create a new one. This key is
crucial for secure SSH access to the instance. The .pem file must be
downloaded and stored securely.
Network settings: Select the security group created in the previous step.
Launch Instance: Review the settings and click Launch instance.
3.3. Connect to the Instance
CC Assignment 4 4
Once the instance is in the "Running" state, you can connect to it using an SSH
client.
In the AWS Console, select your running instance.
Click the Connect button at the top of the page.
3.4. Install and Configure the Web Server (Apache2)
The next step is to install the Apache web server, which will serve the HTML files.
Once connected to the instance via SSH, update the package list:Bash
sudo apt update
Install Apache2:Bash
sudo apt install apache2 -y
Verify that Apache is running:Bash
sudo systemctl status apache2
The output should show "Active: active (running)".
3.5. Create the Webpage
CC Assignment 4 5
The default directory for Apache webpages on Ubuntu is /var/www/html/ .
Navigate to the directory: Bash
cd /var/www/html/
Create an [Link] file using the nano text editor:Bash
sudo nano [Link]
Paste your HTML content into the file. For example:HTML
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage on EC2</title>
</head>
<body>
<h1>Success!</h1>
<p>This webpage was successfully deployed on an AWS EC2 instance.
</p>
</body>
</html>
Save the file by pressing Ctrl + X, then Y, and Enter.
3.6. Access the Webpage
The final step is to access the newly deployed webpage using the public IP
address of the instance.
In the AWS Console, find your instance and copy its Public IPv4 address.
Open a web browser and paste the public IP address into the URL bar.
The webpage should load successfully, displaying the content of your
[Link] file.
CC Assignment 4 6
4. Conclusion
The process successfully demonstrates the complete lifecycle of deploying a
static webpage on a cloud platform. By properly configuring security groups,
launching a compute instance, installing a web server, and publishing content, a
website can be made publicly accessible on the internet. This provides a solid
foundation for more complex web application deployments.
CC Assignment 4 7