Skip to content

About

AWS DevOps project using EC2, Nginx, Apache2, EBS, load balancing, and monitoring

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

☁️ AWS DevOps Infrastructure Project

Production-style AWS infrastructure using EC2, Nginx, Apache2, HTTPS, EBS, Security Groups, and CloudWatch monitoring.


πŸš€ Project Overview

This project demonstrates the deployment of a secure and highly available web infrastructure on AWS using multiple Ubuntu EC2 instances.

The architecture uses:

  • Nginx as the public-facing reverse proxy and load balancer
  • Two Apache2 servers as private backend servers
  • AWS Security Groups to control network communication
  • HTTPS for encrypted client-to-server communication
  • Amazon EBS for persistent storage
  • Amazon CloudWatch for basic infrastructure monitoring

The main goal was to understand how multiple infrastructure components work together to create a secure, scalable, and fault-tolerant web environment.


πŸ—οΈ Architecture

                           🌐 INTERNET
                                β”‚
                         HTTP / HTTPS
                                β”‚
                                β–Ό
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚       EC2-1             β”‚
                 β”‚   Ubuntu + Nginx        β”‚
                 β”‚                         β”‚
                 β”‚ Reverse Proxy           β”‚
                 β”‚ Load Balancer           β”‚
                 β”‚ HTTPS / SSL             β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                       Private AWS Network
                              β”‚
                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚                       β”‚
                  β–Ό                       β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚      EC2-2       β”‚   β”‚      EC2-3       β”‚
        β”‚ Ubuntu + Apache2 β”‚   β”‚ Ubuntu + Apache2 β”‚
        β”‚                  β”‚   β”‚                  β”‚
        β”‚   Backend #1     β”‚   β”‚   Backend #2     β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

                  β”‚
                  β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚   EC2-1 EBS     β”‚
          β”‚   8 GiB gp3     β”‚
          β”‚      /data      β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🎯 Key Features

Feature Implementation
☁️ Cloud Infrastructure 3 Ubuntu EC2 instances
🌐 Reverse Proxy Nginx
βš–οΈ Load Balancing Nginx Round-Robin
πŸ–₯️ Backend Servers 2 Γ— Apache2
πŸ”’ Secure Communication HTTPS / SSL
πŸ›‘οΈ Network Security AWS Security Groups
πŸ’Ύ Persistent Storage 8 GiB gp3 EBS
πŸ“Š Monitoring CloudWatch + Linux utilities
πŸ”„ Failure Testing Backend failure simulation
πŸ“ Documentation Git & GitHub

πŸ”„ Traffic Flow

The application follows this request flow:

Client
  β”‚
  β”‚ HTTP / HTTPS
  β–Ό
Nginx
  β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ί Apache Backend 1
  β”‚
  └──────────────► Apache Backend 2
                         β”‚
                         β–Ό
                    Web Application

Nginx distributes incoming requests between the two Apache2 backend servers using round-robin load balancing.

This allows the application to continue serving traffic even if one backend server becomes unavailable.


🧩 Infrastructure Components

1️⃣ EC2 Infrastructure

Three Ubuntu EC2 instances were deployed:

Instance Role Network
EC2-1 Nginx Reverse Proxy / Load Balancer Public
EC2-2 Apache2 Backend Server 1 Private
EC2-3 Apache2 Backend Server 2 Private

2️⃣ Apache2 Backend Servers

Apache2 was installed and configured on both backend instances.

Both servers host the same custom web application.

The backend servers communicate with Nginx using their private IP addresses.

This prevents direct public access to the backend web servers.


βš–οΈ Nginx Reverse Proxy & Load Balancing

Nginx acts as the entry point for incoming web traffic.

An upstream group was configured containing both Apache2 backend servers:

upstream apache_servers {
    server <BACKEND-1-PRIVATE-IP>;
    server <BACKEND-2-PRIVATE-IP>;
}

Nginx then forwards requests to the backend servers:

location / {
    proxy_pass http://apache_servers;
}

πŸ” Load Balancing Method

The project uses round-robin load balancing.

Request 1 ──► Backend 1
Request 2 ──► Backend 2
Request 3 ──► Backend 1
Request 4 ──► Backend 2

This distributes incoming traffic across both backend servers.


πŸ” HTTPS / SSL

HTTPS was configured on the public Nginx server using a self-signed SSL certificate.

Client
  β”‚
  β”‚ HTTPS
  β–Ό
Nginx
  β”‚
  β”‚ HTTP
  β–Ό
Private Apache Backends

⚠️ Since this project uses a self-signed certificate without a registered domain, browsers may display a certificate warning. This is expected for the project environment.


πŸ›‘οΈ Security Architecture

Security Groups were configured to restrict communication between the infrastructure components.

Public Nginx Server

Allows:

HTTP  β†’ Internet
HTTPS β†’ Internet
SSH   β†’ Administrator IP

Private Apache Servers

Allow:

HTTP β†’ Nginx Security Group
SSH  β†’ Restricted Administration

The backend servers are therefore not directly exposed to the public internet.

πŸ”’ Security Flow

                INTERNET
                    β”‚
                    β–Ό
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚   NGINX     β”‚
             β”‚ Public EC2  β”‚
             β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
             Private Network
                    β”‚
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”
            β–Ό               β–Ό
        Apache #1        Apache #2
         Private          Private

πŸ’Ύ EBS Persistent Storage

An 8 GiB gp3 EBS volume was attached to the Nginx EC2 instance.

The volume was mounted at:

/data

The mount configuration was added to:

/etc/fstab

The volume UUID was used to ensure that the storage remains automatically mounted after a server reboot.

Storage Verification

df -h
lsblk

πŸ“Š Monitoring

Basic infrastructure monitoring was performed using Amazon CloudWatch and Linux system utilities.

Monitoring Commands

df -h
free -h
systemctl status nginx
systemctl status apache2

CloudWatch was used to monitor infrastructure-level metrics such as CPU utilization.


πŸ§ͺ Failure Testing

To verify the resilience of the load-balanced architecture, one Apache backend server was intentionally stopped.

Before Failure

Nginx
 β”œβ”€β”€β–Ί Apache #1 βœ…
 └──► Apache #2 βœ…


After Stopping Apache #1

Nginx
 β”œβ”€β”€β–Ί Apache #1 ❌
 └──► Apache #2 βœ…

Traffic continued through the remaining backend server.

This demonstrated the practical benefit of having multiple backend servers behind the Nginx load balancer.


βœ… Project Verification

The infrastructure was verified through multiple tests.

EC2 Infrastructure

  • 3 Ubuntu EC2 instances successfully configured
  • Nginx deployed on the public-facing instance
  • Apache2 deployed on both backend instances

Nginx & Apache

  • Nginx service verified as active
  • Both Apache2 servers successfully served the application
  • Backend communication verified through private IP addresses
  • HTTP 200 OK responses confirmed

HTTPS

  • HTTPS endpoint successfully configured
  • HTTPS requests returned successful responses
  • Self-signed certificate warning expected in browsers

EBS

  • 8 GiB gp3 EBS volume attached
  • Volume mounted at /data
  • Persistent mount configured using /etc/fstab
  • Persistence verified after reboot

Load Balancing

  • Round-robin distribution configured
  • Backend failure scenario tested
  • Remaining backend continued serving requests

🌐 Deployed Application

A custom DevOps Cloud web application was deployed on both Apache2 backend servers.

Users access the application through the public Nginx endpoint.

User
 β”‚
 β–Ό
HTTPS
 β”‚
 β–Ό
Nginx
 β”‚
 β”œβ”€β”€β”€β”€β”€β”€β–Ί Apache #1
 β”‚
 └──────► Apache #2
             β”‚
             β–Ό
       DevOps Cloud Website

πŸ“š What I Learned

This project provided hands-on experience with:

  • ☁️ AWS EC2 infrastructure
  • 🐧 Ubuntu server administration
  • 🌐 Nginx reverse proxy configuration
  • βš–οΈ Load balancing
  • πŸ–₯️ Apache2 web server deployment
  • πŸ” HTTPS / SSL configuration
  • πŸ›‘οΈ AWS Security Groups
  • πŸ’Ύ EBS persistent storage
  • πŸ“Š CloudWatch monitoring
  • πŸ”„ Failure testing
  • 🌐 Private networking
  • πŸ”§ Linux service management
  • πŸ™ Git & GitHub

πŸ’‘ Project Outcome

This project demonstrates how a multi-server web architecture can be designed and deployed using AWS infrastructure.

The implementation combines:

EC2
 β”‚
 β”œβ”€β”€ Nginx
 β”‚     β”œβ”€β”€ Reverse Proxy
 β”‚     β”œβ”€β”€ Load Balancer
 β”‚     └── HTTPS
 β”‚
 β”œβ”€β”€ Apache2 Backend #1
 β”‚
 β”œβ”€β”€ Apache2 Backend #2
 β”‚
 β”œβ”€β”€ Security Groups
 β”‚
 β”œβ”€β”€ EBS
 β”‚
 └── CloudWatch

It provided a strong practical foundation for understanding AWS infrastructure, web server administration, networking, security, load balancing, and DevOps fundamentals.


πŸš€ Future Improvements

The architecture can be further enhanced with:

  • πŸ”’ Let's Encrypt SSL certificates
  • 🌐 Custom domain name
  • βš–οΈ AWS Application Load Balancer
  • πŸ“ˆ Auto Scaling
  • πŸ“Š Advanced CloudWatch dashboards
  • 🚨 CloudWatch alarms & SNS notifications
  • πŸ—οΈ Infrastructure as Code using Terraform
  • πŸ”„ CI/CD pipeline
  • 🐳 Containerization
  • πŸ€– Automated deployments

πŸ‘¨β€πŸ’» Author

Sparsh Jambhulkar

πŸŽ“ B.Tech β€” Robotics & Artificial Intelligence

Interests: AWS β€’ Cloud β€’ DevOps β€’ Linux β€’ Infrastructure


⭐ If you found this project useful, consider giving the repository a star!

Built as part of my hands-on journey into AWS & DevOps.

About

AWS DevOps project using EC2, Nginx, Apache2, EBS, load balancing, and monitoring

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors