wordpress-with-LB / README.md
README.md
Raw

wordpress-with-LB

This cloud project involves the configuration of WordPress site in multiple AWS instances sharing the same configuration, and then using a LoadBalancer to direct traffic to the instances. The database used for the configuration is Amazon RDS (MySQL). Steps involved in the project include...

  1. Create a custom VPC, with 2 public subnets (For the LoadBalancer), 2 private subnets (For the WordPress site servers) and 2 private subnets for database.

  2. Two Route tables are also created - one public and the other private. The public route table uses internet gateway to communicate with the internet and it's associated with the 2 public subnets for the LoadBalancer. The private route table uses NAT gateway to communicate with the internet and is associated with the 2 private subnets for the servers.

  3. Create a database instance in private subnets, with database name, username, password and ensuring the database is only accessible by the servers containing the WordPress site. (This is achienced using security group rules)

  4. A launch template is created using a custom script to install Apache, PHP, WordPress, with the necessary configurations, at the time of launching.

  5. Target group and LoadBalancer are created.

  6. Autoscaling group is created using the above LaunchTemplate and setting desired, minimum, and maximum instance count to 2. No autoscaling rule is defined (as this is just for testing/ practise purpose)

  7. The security group associated with the LoadBalancer allows inbound traffic from the internet on port 80, while the one associated with the WordPress servers that would be launched by the Autoscaling group allow traffic from the LoadBalancer on port 80 (Apache default port).

  8. The WordPress sites are then accessed over the browser using the LoadBalancer URL.