Skip to content

Latest commit

 

History

History
71 lines (42 loc) · 1.35 KB

File metadata and controls

71 lines (42 loc) · 1.35 KB

ec2statichosting

Guide for learners to host a static web app on an EC2 instance of AWS.

🌐 EC2 Static Hosting Website

This repo contains a simple static website (index.html, error.html, and style.css) for hosting on an AWS EC2 Ubuntu instance using Apache2.

📁 Files

ec2statichosting/

├── index.html # Homepage
├── error.html # Error page
└── style.css # CSS Styling

🚀 Deployment on EC2

✅ Prerequisites :

  • EC2 instance (Ubuntu)
  • Apache2 & Git installed
  • .pem SSH key

🔧 Steps

  1. SSH into EC2 :

ssh -i "your-key.pem" ubuntu@your-ec2-public-ip

  1. Install Apache & Git :

sudo apt update
sudo apt install apache2 git -y

  1. Go to Apache root :

cd /var/www/html

  1. Remove default files:

sudo rm -rf *

  1. Clone this repo :

sudo git clone https://github.com/HackRore/ec2statichosting.git .

  1. Restart Apache :

sudo systemctl restart apache2

🌍 Access Website

Visit:

http://your-ec2-public-ip

✅ index.html loads homepage
❌ Wrong paths show error.html

📺 Video Tutorial

Watch full step-by-step guide on YouTube:
https://youtube.com/@CyberTechX_ravin

👨‍💻 Author

CyberTechX_ravin 🎓 B.E. (AI & DS)
🔐 Cybersecurity & Cloud Enthusiast
GitHub: https://github.com/HackRore
YouTube: https://youtube.com/@CyberTechX_ravin