Configuring front-End as WordPress with the backend as AWS RDS

~ RDS + EC2 + WordPress

Gaurav Pagare
5 min readMar 4, 2021

What is Amazon RDS ?

Amazon Relational Database Service (Amazon RDS) makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while automating time-consuming administration tasks such as hardware provisioning, database setup, patching and backups. It frees you to focus on your applications so you can give them the fast performance, high availability, security and compatibility they need.

Amazon RDS is available on several database instance types -optimized for memory, performance or I/O -and provides you with six familiar database engines to choose from, including Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle Database, and SQL Server. You can use the AWS Database Migration Service to easily migrate or replicate your existing databases to Amazon RDS.

Task Description :

  1. Create an AWS EC2 instance
  2. Configure the instance with Apache Web server.
  3. Download the php application name “WordPress”.
  4. As WordPress stores data at the backend in MySQL Database server. Therefore, you need to set up a MySQL server using AWS RDS service using Free Tier.
  5. Provide the endpoint/connection string to the WordPress application to make it work.

Part 1: Configuring Ec2-instance with WordPress

Step 1: Launch an ec2-instance on the AWS cloud for this you can refer my previous article - here.

Here I have Launched ec2-instance with Name tag as RDS-Task.

Step 2: Install httpd package in the system.

Step 3: Download php application name “WordPress”. Extract the Downloaded file and move it to the Document root of httpd.

(Note: WordPress is an php application so we need to install php in the system)

link for the package: https://wordpress.org/latest.tar.gz

Step 4: Start the Services

Step 5: Test

Part 2: Configuring Backend Amazon RDS

Step 1: From Amazon Console Go to RDS services and from there the Create Database. Here we need to choose the creation method Standard or easy

Next we Also need to Put the Database Engine to use in my case I have selected MySQL with the version 5.7.31. we need to tell template (free tier, production or Test)

Step 2: Now we need to configure the settings of the Database like name of database (In my case I used the name of DB as WordPress-DB-1), settings regarding credentials

Step 3: Select the instance to us for the database. these are the special purpose instance types meant for the databases (In my case I am using free tier so other options are not available only rather than Burstable class)

Step 4: We also need to configure the storage by default they give General purpose (SSD) with 20 gb and auto scaling enabled

Step 5: Do the required n/w and security setting i.e which vpc to use, access to the database public/ private. firewall to use pre-created or create new. also set the port to use for the database.

In my case I have used the default vpc with the pre-created firewalld which allow all traffic to port 3306 and wee have given a public access to the data

Step 6: Select the authentication method we require require to access the database

Step 7: Giving backup policy and databases name. further options for monitoring, delete protections are also available we can use them if we need. after all this just click on create database and within a few seconds we have our database ready.

In my case I have created a database with the name mywp and enabled delete protections and rest all the things are at default state.

Part 3: Connect the Frontend with the Backend

For the connection we require the credentials and the name of database

Here Our WordPress application is been launched successfully it means we have a fantastic connectivity with our MySQL 😃

So Now let’s go to MySQL and see our Amazon RDS database after the installation of WordPress.

To connect to the MySQL database we need a client side package MySQL so we will first install it and then connect via endpoint

Thankyou For Reading

Any query and suggestion are always welcome- Gaurav Pagare

--

--

Gaurav Pagare

I am a passionate & dedicated guy aiming for achieving excellence in life. Exploring the latest technologies and tools. Passionate to learn those