Deploy WordPress Over EC2 instance Using AWS RDS as MYSQL Database Server.

Rohit Raut
3 min readMar 28, 2021

AWS RDS(Relational Database Service)

Amazon RDS is a managed relational database service that provides you six familiar database engines to choose from, including Amazon Aurora, MySQL, MariaDB, Oracle, Microsoft SQL Server, and PostgreSQL.

Amazon RDS makes it easy to use replication to enhance availability and reliability for production workloads. Using the Multi-AZ deployment option, you can run mission-critical workloads with high availability and built-in automated fail-over from your primary database to a synchronously replicated secondary database. Using Read Replicas, you can scale out beyond the capacity of a single database deployment for read-heavy database workloads.

STEPS:

  1. Create Database Server Using AWS RDS(Relational Database Service).
  2. Provision an EC2 Instance.
  3. Configure an environment for the WordPress application.
  4. Download the WordPress application and configure it.
  5. Configuring WordPress, provide the endpoint/connection string to WordPress.

Step-1: Create Database Server Using AWS RDS(Relational Database Service).

We need an RDS-MYSQL instance with public access and for this follows below steps shown in the pictures.

RDS-MYSQL-CONF

One more thing you have to change and is the security group of this MYSQL instance.

RDS-Security Group

Instead of giving source “anywhere” you can provide a security group of your instance.

Step-2: Provision an EC2 Instance.

I am using Amazon AMI in this demo.

AMI

Give proper tag value and security group to the instance. As we need to login into the system and to access the front of WordPress allow ports 22 and 80 respectively.

Instance Spec

That's all and click on next-next and launch instance.

Step-3: Configure an environment for the WordPress application.

As WordPress application is written in PHP we have to instance PHP having version 7.0+ and To use this website we need a webserver.

Install Apache Webserver and PHP

Install HTTPD and PHP

Step-4: Download the WordPress application and configure it.

wget https://wordpress.org/latest.tar.gz
Download WordPress and Extract

Copy or move content inside wordpress and Start the webserver server.

Setup

Step-5: Configuring WordPress, provide the endpoint/connection string to WordPress.

Copy all content in a file with the name wp-config.php

If you see below the left Image that means you have successfully set up a WordPress application.

Congratulations🤩, we are Successful in deploying WordPress applications on an EC2 instance using RDS-MySQL Database.

follow me for more interesting and technology-related articles.

Thank you for reading😇.

--

--