Configure WordPress using AWS RDS

RDS is a a relational database service provided by AWS. It is fully managed by AWS and we as users only need to use this service and don't need create and manage our own database.

The database engines provided by AWS are

In this task we use MySQL so provide us the database for the WordPress website hosted on EC2. Since MySQL is fully managed by AWS so we don't need to worry about the security of data as well as the storage capacity as this will be taken care by AWS

EC2 is the compute service by AWS which allows us to launch any OS on the cloud with pay as you use model. There are various AMI available to choose from and also there is option to choose the resources that we need in our instance.

Step 1: Create an EC2 instance with RHEL as AMI

Step 2: Provide Security group as with rules

port 22 for ssh

port 80 for http

port 8080 for exposing our podman container

One must have basics about launching EC2 instance. Launch instance successfully after attaching a key in it

Step 3: Create Database using RDS

  1. Select MySQL as database engine
  2. Choose MySQL 5.7.31 version
  3. Template as free Tier since we do not want extra charges and this is for testing purpose only
  4. Provide database identifier name
  5. Provide Master DB name
  6. Provide DB password
  7. Check Public Access to No as we do not want anyone from public internet to access DB directly
  8. Choose that security port that has port 3306 enabled this is the port on which MySQL works
  9. Also we need to edit SG in which Source is SG of EC2 instance from which we need to connect RDS
  10. Provide initial database name as db1
  11. Finally Click Create Database

Database Creation will take some time. Till that time we can configure our EC2 instance for Apache webserver & WordPress

Step 4: Login to instance and install Apache Webserver also we need to install podman which is containerization engine for RHEL.

yum install httpd podman -y
Apache Webserver installing
Installing Podman

Step 5: We need to run podman container having WordPress image

podman run -dit -- name os1 -p 8080:80 wordpress
Running WordPress Container

Step 6: Now Access the EC2 instance IP with port 8080. You will see WordPress Website and now we need to install WordPress

Step 7: Take Endpoint URL from Database created and fill the entries in WordPress website with username and password created and RDS Endpoint

And Voila! Your WordPress Website is up and running

A Video of complete Process is shown below

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store