Setting up WordPress application in AWS using RDS.

ivsntejesh
4 min readMar 6, 2021

Hello everyone,

Today I am going to discuss how can we set up a WordPress application in an EC2 instance and using the RDS for storing the data.

Task details:

đź”… Create an AWS EC2 instance
đź”… Configure the instance with Apache Webserver.
🔅 Download PHP application name “WordPress”.
đź”… WordPress stores data at the backend in the MySQL Database Server. Therefore, you need to set up a MySQL server using AWS RDS service using Free Tier.
đź”… Provide the endpoint/connection string to the WordPress application to make it work.

First, we will launch the EC2 instance, I have launched one EC2 instance as you can see below,

Next, we will download the software that is required for the application.

  1. Httpd
  2. Php
  3. MySQL
  4. WordPress PHP application file.

run these commands;

yum install httpd -y

yum install mysql -y

amazon-linux-extras install php7.2 -y

These are the outputs we can see below,

SQL software:

Php software:

start the webserver service,

systemctl start httpd

Next, we will get the installation package of the WordPress application,

To download the app use

wget https://wordpress.org/latest.tar.gz

This downloads the zip or tar file of the package. To unzip or untar it use the following command,

This untars the file and stores the package in the “/var/www/html” folder.

Now restart the service using

systemctl restart httpd

Goto any browser, open terminal, and copy-paste the IP address of EC2 instance with WordPress at the last, like “http://IP_EC2_instance/wordpress”

We can see the below terminal, now we have to connect our frontend to the backend.

Now we will launch an RDS DB, to this application I am using MySQL as my storage unit. The version of MySQL is 5.7.31.

I am selecting the free tire eligibility,

Give the Database name, and create a DB account that will be used in the future.

Give public access yes if you want to give access to instances that are present outside the VPC.

Now after clicking create we can see DB is creating.

Now we can see using the below command to connect to the RDS DB. Now we have to create a DB that we can share with others,

Create a database,

Give the details in the web applications,

If any error, copy the file and paste it into the WordPress document.

Give your details and submit, Now we can see the success message which clearly shows we have deployed the application.

This completes task-18 of ARTH, I would like to thank Vimal sir.

Connect to me on LinkedIn if you have any doubts.

--

--