You are currently viewing How to Install WordPress CMS on AWS Cloud platform

How to Install WordPress CMS on AWS Cloud platform

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.

How to Install WordPress on AWS Cloud

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.

2. Setup 2 security groups (inbound traffic for DMZ open at port 80, 443 & 22 and inbound traffic for RDS open at mysql 3306 with security group of DMZ) – Source 0.0.0.0/0
 
3. Create RDS mysql t2.micro – db instance, existing vpcsecurity group RDS, select multi-Az create replica in different zone, Choose No to public accessibility.
 

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

How to Install WordPress on AWS Cloud - WP Login Page

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.

How to Install WordPress on AWS Cloud - WP Dashboard

Please get in touch or let us know through comment sections below, if you experience any issues or need technical help

🙂

Spread the love

team_cicdtrail

Only for Editorials, blogs and articles.

Leave a Reply