Objective
This procedure contains steps to create fault tolerant and Install WordPress CMS on AWS Cloud platform using manual as well as CloudFormation. This procedure gives good exposure to navigation around Amazon Web Services (AWS) Console while using multiple services in through out exercise.
Requirements
-
Familiarity with AWS console
-
Free Tier AWS Account
Step by Step Instructions to Install WordPress CMS on AWS Cloud Platform
1. Login to AWS Management Console.
4. Create 2 x S3 buckets (ex: wordpressCode and wordpressImage)
5. Create CloudFront Distribution – note down domain name (Origin Access Identity create new or use existing one), select Grant Read Permission – Yes
6. Route53 – register dns or use LoadBalancer DNS address.
7. IAM – create role for S3FullAccess.
8. Create EC2 Linux 2 AMI HVM t2.micro. Select IAM role created in step#6. Use below Bootstrap script:
#!/bin/bash yum install httpd php php-mysql -y cd /var/www/html echo “healthy” > healthy.html wget https://wordpress.org/latest.tar.gz tar -xzf latest.tar.gz cp -r wordpress/* /var/www/html/ rm -rf wordpress rm -rf latest.tar.gz chmod -R 755 wp-content chown -R apache:apache wp-content wget https://s3.amazonaws.com/bucketforwordpresslab-donotdelete/htaccess.txt mv htaccess.txt .htaccess chkconfig httpd on
9. Select security DMZ group created in step
10. Create new key pair or use existing one if you have one.
11. Login to EC2 using [email protected] (xx.xx.xx.xx = EC2 IP Address)
12. Start webserver:
systemctl start httpd
13. From AWS console get RDS endpoint
14. Open Site using public IP of webserver (EC2 instance) and fill details. Database Host is endpoint from step 10 above:
15. Click Submit and copy script on next screen and paste it in vi /var/www/html/wp-config.php
16. wq! to save file and run WordPress installation in browser.
Conclusion
Now you should be welcomed on WordPress Dashboard, ready to create glossy webpages, blogs, articles, add images and videos etc.
Please get in touch or let us know through comment sections below, if you experience any issues or need technical help
🙂