Integration Of WordPress with Amazon RDS on AWS

Tilwani Hardik
5 min readJun 17, 2022
Source : Owner

What Is AWS ???

Source : Owner
  • Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 175 fully featured services from data centers globally. Millions of customers — including the fastest-growing startups, largest enterprises, and leading government agencies — are using AWS to lower costs, become more agile, and innovate faster.

What is AWS-RDS ???

Source : Owner
  • Amazon RDS is the Relational Database Service offered as a web service by Amazon.
  • It makes it easy to set-up and operate a relational database in the cloud. It provides a very cost-effective way to use industry’s leading RDBMS software as a managed service.
  • Because of this web service from amazon AWS, You do not have to buy any server or install any database software in it.
  • You just have subscribe to the AWS RDS web service and start using the RDBMS features after some initial configuration involving memory and CPU capacity allocation etc.

What is WordPress ???

Source : Owner
  • WordPress is an open source Content Management System (CMS), which allows the users to build dynamic websites and blog.
  • WordPress is the most popular blogging system on the web and allows updating, customizing and managing the website from its back-end CMS and components.
  • WordPress is an excellent website platform for a variety of websites. From blogging to e-commerce to business and portfolio websites, itis a versatile CMS.
  • Designed with usability and flexibility in mind, it is a great solution for both large and small websites.

Our Task Scenario Step By Step :

  • Launch an EC2 instance For Deploying WordPress
  • Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.
  • Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment.
  • For launching EC2 instance you can refer below mentioned link:

https://docs.aws.amazon.com/quickstarts/latest/vmlaunch/step-1-launch-instance.html

  • Here I launched the Amazon Linux 2 instance using AWS Management Console, you can also use AWS CLIv2 which is the Command Line Version.

To connect from the Amazon EC2 console :

  • Open the Amazon EC2 console
  • In the left navigation pane, choose Instances and select the instance to which to connect
  • Choose Connect
  • Install “ httpd ” software which will be useful for configuring instance as webserver

amazon-linux-extras install php7.3

// It will install the software & dependencies

Download WordPress code from the Internet and Extract it —

The following command will download the WordPress from Internet.

curl https://wordpress.org/latest.tar.gz --output wordpress.tar.gz

Also we have to extract it.

tar xf wordpress.tar.gz// The Linux ‘tar’ stands for tape archive, is used to create Archive and extract the Archive files. tar command in Linux is one of the important command which provides archiving functionality in Linux.

Now, Copy the extracted WordPress directory into the “ /var/www/html ” directory:

Here’s how to copy a directory in Linux using command :

cp -r source_directory destination_directory
cp -r wordpress /var/www/html
systemctl start httpd
// To start Apache web server

Create RDS database For WordPress —

To create a MySQL DB instance :

1)Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/
2) In the upper-right corner of the AWS Management Console, choose the AWS Region where you want to create the DB instance.
3) In the navigation pane, choose Databases.
4) Choose Create database.
5) On the Create database page, shown following, make sure that the Standard Create option is chosen, and then choose MySQL.

Here I am using free tier account so In the Templates section, choose the Free tier.

6) In the Settings section, set these values :

DB instance identifier — Mydb
Master username — Give username
Auto-generate a password — Disable the option
Master password — Choose a password
Confirm password — Retype the password

7) In the DB instance size section :

In the Storage and Availability & durability section, Use default values.

8) In the Connectivity section, use default values or you can set as per your requirements :

9) Now just create the database :

10) Wait for the Status of your new DB instance to show as Available, after some minutes you will see that the database is created.

You can also access this database from the terminal :

Lastly, provide the endpoint/connection string to the WordPress application to make it work :

Finally, we have successfully deployed our required scenario by Integrating Amazon RDS on AWS.

Thank You for reading & learning with me.

--

--