28
Multi-tier Architecture on AWS
VPC
Public Subnet - 1
Public Subnet - 2
Private Subnet - 1
Private Subnet - 2
Created
IGW
Attached to VPC
Private Route table for VPC
NAT Gateway with attached Elastic IP
Associate private subnets with NAT Gateway
Associate NAT gateway to Private RT
Attach private subnets to Private RT
Attach IGW to Public RT
sudo amazon-linux-extras install -y php7.2
sudo service httpd restart
Installing Wordpress: Official tutorial
wget https://wordpress.org/latest.tar.gz
Extracted the downloaded package from wordpress with
tar -xzf latest.tar.gz
Moved the contents of wordpress directory to /var/www/html
cd /etc/httpd/conf
edit httpd.conf
Search for "AllowOverride None" change None
to All
.
It is in /var/www/html
directory.
Change permissions on html directory.
chown -R apache:apache /var/www/html
.
Wordpress opens on the Public IP of EC2 instance!
http://18.***.161.241/wp-admin/setup-config.php
Check whether RDS is accessible via EC2 instance.
After configuring the dbname,username, password, hostname the wordpress application is up and running on Public IP of EC2 instance on the browser!
6. Create Route53 hosted zone to map with domain.
The ELB DNS is configured as an A record for the domain name wordpress.komlalebu.com
.
7. Create AMI for EC2.
8. Create ELB.
The EC2 instances are now accessed with the ELB DNS.
9. Create launch configuration from AMI.
10. Create ASG for launch configuration.
VPC - Komla-VPC
Subnets - Public subnets
ELB - Komla-ELB
Desired - 2 instances
Minimum - 1 instances
Maximun - 2 instances