Production-ready WordPress deployment on AWS with automatic failover and high availability across multiple availability zones. This infrastructure can handle instance failures with zero downtime through intelligent load balancing and auto-scaling.
Status: β
Live and Running
URL: http://wordpress-alb-543074365.us-east-1.elb.amazonaws.com
Uptime: 99.9%+
Internet
β
Application Load Balancer
β
ββββββββββββββββββββββ΄βββββββββββββββββββββ
β Auto Scaling Group β
β βββββββββββββββ βββββββββββββββ β
β β EC2 (AZ-a) β β EC2 (AZ-b) β β
β β WordPress β β WordPress β β
β ββββββββ¬ββββββββ βββββββββ¬βββββββ β
βββββββββββββΌβββββββββββββββββββΌββββββββββββ
β β
ββββββββββ΄βββββββββββββββββββ΄βββββββββ
β Amazon EFS (Shared Storage) β
ββββββββββββββββββ¬ββββββββββββββββββββ
β
ββββββββββ΄βββββββββ
β Amazon RDS β
β MySQL Database β
βββββββββββββββββββ
- Cloud Provider: AWS (Amazon Web Services)
- Compute: EC2 (t2.micro instances)
- Load Balancing: Application Load Balancer (ALB)
- Auto Scaling: Auto Scaling Groups (2-4 instances)
- Database: Amazon RDS MySQL 8.0
- Storage: Amazon EFS (Elastic File System)
- Networking: VPC, Subnets, Security Groups, Internet Gateway
- IAM: Instance Profiles and Roles
- OS: Amazon Linux 2023
- Web Server: Apache with PHP-FPM
- CMS: WordPress 6.8.3
- Automation: AWS CLI, Bash scripting
- β High Availability: Multi-AZ deployment across 2 availability zones
- β Auto Scaling: Automatically scales from 2 to 4 instances based on demand
- β Zero Downtime: Instant failover when instances fail (<1 second)
- β Load Balancing: Even distribution of traffic across healthy instances
- β Shared Storage: EFS ensures file consistency across all instances
- β Managed Database: RDS with automated backups and encryption
- β Security: Custom security groups with least-privilege access
- β Monitoring: Health checks every 30 seconds
- β Automated Recovery: Failed instances automatically replaced
| Component | Specification |
|---|---|
| Region | us-east-1 |
| Availability Zones | us-east-1a, us-east-1b |
| VPC CIDR | 10.0.0.0/16 |
| Public Subnets | 10.0.1.0/24, 10.0.2.0/24 |
| Private Subnets | 10.0.3.0/24, 10.0.4.0/24 |
| Instance Type | t2.micro |
| Database Class | db.t3.micro |
| Storage | 20GB encrypted |
| Min Instances | 2 |
| Max Instances | 4 |
- AWS Account with appropriate permissions
- AWS CLI installed and configured
- SSH key pair
- Basic knowledge of Linux and AWS services
- Clone the repository
git clone https://github.com/Ofony-85/aws-wordpress-ha.git
cd aws-wordpress-ha- Configure AWS credentials
aws configure
3. **Access WordPress**
- Navigate to the ALB DNS name provided in the output
- Complete WordPress installation wizard
## π Project Structureaws-wordpress-ha/ βββ README.md βββ docs/ β βββ DEPLOYMENT_GUIDE.md β βββ ARCHITECTURE.md β βββ TROUBLESHOOTING.md βββ scripts/ β βββ deploy.sh β βββ cleanup.sh β βββ user-data.sh β βββ monitor.sh βββ screenshots/ β βββ architecture-diagram.png β βββ wordpress-dashboard.png β βββ aws-console-ec2.png β βββ cloudwatch-metrics.png βββ resource-ids.txt
## π Security Features
- **Network Isolation:** Public and private subnets
- **Security Groups:** Strict ingress/egress rules
- **Database Encryption:** Storage encryption at rest
- **Private Database:** RDS not publicly accessible
- **IAM Roles:** Instance profiles for EFS access
- **HTTPS Ready:** Can be configured with ACM certificate
## π Performance Metrics
- **Availability:** 99.9%+
- **Failover Time:** <1 second
- **Auto Scaling Response:** 2-5 minutes
- **Health Check Interval:** 30 seconds
- **Database Backup:** Automated daily with 7-day retention
## π§ͺ Testing
### High Availability Test
```bash
# Stop one instance
aws ec2 stop-instances --instance-ids i-xxxxx
# Website continues to work
# Auto Scaling launches replacement within 5 minutes
# Monitor Auto Scaling behavior
watch -n 30 'aws autoscaling describe-auto-scaling-groups \
--auto-scaling-group-names WordPress-ASG'Monthly Cost: ~$50-70 (without free tier)
Breakdown:
- EC2 (2x t2.micro): ~$15
- RDS (db.t3.micro): ~$15
- ALB: ~$16
- EFS: ~$0.30/GB
- Data Transfer: Varies
Free Tier Eligible:
- EC2: 750 hours/month (first 12 months)
- RDS: 750 hours/month (first 12 months)
- ALB: 750 hours/month + 15GB data (first 12 months)
- Update WordPress core, themes, and plugins weekly
- Monitor CloudWatch metrics and logs
- Review RDS backup retention
- Check security group rules monthly
- Test disaster recovery procedures quarterly
Unhealthy Targets
- Check security groups allow HTTP from ALB
- Verify EFS is mounted
- Check Apache status
Database Connection Error
- Verify wp-config.php credentials
- Check RDS security group
- Test connection from EC2
- Designing multi-tier architectures on AWS
- Implementing high availability and fault tolerance
- Configuring load balancers and auto scaling
- Managing shared storage across instances
- Database administration with RDS
- Infrastructure automation with AWS CLI
- Security best practices in the cloud
- Cost optimization strategies
- Add HTTPS with AWS Certificate Manager
- Implement CloudFront CDN
- Add Route 53 for custom domain
- Implement AWS WAF for security
- Add CloudWatch alarms and SNS notifications
- Convert to Infrastructure as Code (Terraform)
- Implement CI/CD pipeline
- Add Redis/Memcached for caching
- Implement backup automation with AWS Backup
- Multi-region deployment
This project is licensed under the MIT License - see the LICENSE file for details.
Ofonime Offong
- GitHub: @Ofony-85
- LinkedIn: Ofonime Offong
- Email: ofonyme3@gmail.com
- AWS Documentation
- WordPress.org
- Cloud Academy tutorials
- AWS Well-Architected Framework
+2348038854115
For questions or collaboration opportunities, feel free to reach out!
β If you find this project useful, please consider giving it a star!