Deploying a Static Website on an EC2 Instance

In this project, I deployed a static website on an AWS EC2 instance. This approach involves setting up and managing a virtual server, giving you more control over the environment compared to using S3. By configuring an EC2 instance to serve static content, you'll gain experience in server management, security configurations, and automation through Infrastructure as Code (IaC) tools. This project demonstrates proficiency in cloud infrastructure, operating system management, and DevOps practices, resulting in a robust, scalable, and secure web hosting solution.

Technologies: HTML CSS JavaScript AWS EC2

Instructions

Step 1: Launch EC2 Instance

Launch an EC2 instance using the AWS Management Console. Choose an appropriate AMI (e.g., Ubuntu 24.04 LTS) and instance type (e.g., t2.micro for free tier eligibility).

Step 2: Configure Security Groups

Configure the security group to allow inbound traffic on HTTP (port 80) and SSH (port 22) to access your website and manage the instance.

Step 3: Connect to Your Instance

Use SSH to connect to your EC2 instance. Linux, Mac and Windows ships with an SSH client, you can use their terminal.

Step 4: Install Web Server

Install a web server such as Apache or Nginx. For example, to install Apache, you can use the following command: sudo apt install apache2 -y.

Step 5: Deploy Website Files

Upload your static website files to the web server's root directory (e.g., /var/www/html for Apache). You can use SCP or SFTP for file transfer.

Step 6: Start the Web Server

Start the web server using a command like sudo systemctl start apache2. Ensure the web server starts on boot by enabling it: sudo systemctl enable apache2.

Step 7: Access Your Website

Open a web browser and navigate to your EC2 instance's public IP address to view your deployed website.

Concepts

IAM Roles and Policies

Security Groups

SSH and Secure Connections

Web Server Configuration

Infrastructure as Code (IaC)

CI/CD

Services

EC2

Ubuntu

Apache

IAM

Github Actions