Guide for learners to host a static web app on an EC2 instance of AWS.
This repo contains a simple static website (index.html, error.html, and style.css) for hosting on an AWS EC2 Ubuntu instance using Apache2.
ec2statichosting/
├── index.html # Homepage
├── error.html # Error page
└── style.css # CSS Styling
- EC2 instance (Ubuntu)
- Apache2 & Git installed
.pemSSH key
- SSH into EC2 :
ssh -i "your-key.pem" ubuntu@your-ec2-public-ip
- Install Apache & Git :
sudo apt update
sudo apt install apache2 git -y
- Go to Apache root :
cd /var/www/html
- Remove default files:
sudo rm -rf *
- Clone this repo :
sudo git clone https://github.com/HackRore/ec2statichosting.git .
- Restart Apache :
sudo systemctl restart apache2
Visit:
✅ index.html loads homepage
❌ Wrong paths show error.html
Watch full step-by-step guide on YouTube:
https://youtube.com/@CyberTechX_ravin
CyberTechX_ravin
🎓 B.E. (AI & DS)
🔐 Cybersecurity & Cloud Enthusiast
GitHub: https://github.com/HackRore
YouTube: https://youtube.com/@CyberTechX_ravin