Integration of Amazon Relational Database Service (RDS) with WordPress on AWS

Shubhamkhandelwal
6 min readMar 23, 2021

What is DataBase ?

A database is an organized collection of data so that it can be easily accessed and managed. You can organize data into tables, rows, columns, and index it to make it easier to find relevant information. Database handlers create a database in such a way that only one set of software programs provides access to data to all the users.

What is AWS-RDS?

Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up, operate, and scale a relational database in the AWS Cloud. It provides cost-efficient, resizable capacity for an industry-standard relational database and manages common database administration tasks.

Amazon Relational Database Service is a distributed relational database service by Amazon Web Services. It is a web service running “in the cloud” designed to simplify the setup, operation, and scaling of a relational database for use in applications.

What is WordPress?

WordPress is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database. Features include a plugin architecture and a template system, referred to within WordPress as Themes.

Task Description:-

* Create an AWS EC2 instance

* Configure the instance with Apache Webserver.

* Download PHP application name “WordPress”.

* As 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.

Task Solution:-

→ Here we are launching AWS EC2 instance

In this step, I will create an Amazon EC2 instance to run the WordPress site.To create EC2 instance, go to Amazon EC2 in the AWS console follow the below steps shown in the screenshots:-

Selecting AMI

→ So our Instance is Launched and now we are going to install requires software for wordpress.

The following commands will configure the instance with apache webserver

dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

dnf install httpd -y

* start the services

systemctl start httpd

* check the status , it is running or not

systemctl status httpd

Httpd checked through IP

* Installing PHP software

dnf install http://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf module install php:remi-7.4

dnf install php-mysqlnd

→ Configuring mysql database:

* Installing mysql software
dnf install mysql -y

After that login inside the mysql database

mysql -h <db_endpoint_URL> -u <username of your database -p>

→ Configuring Wordpress:

* To install wget

Yum install wget -y

Wget http://wordpress.org/latest.tar.gz

We have to Unzip the file

tar -xvzf latest.tar.gz -C /var/www/html

Now, we have to configure the wordpress inside the /var/www/html directory

After this Restart the Apache webserver services

→ Create RDS database For WordPress:-

Now we can creating new Database using RDS service of AWS. You just follow below steps to lunch database.

→ First go to RDS service and select create database option .Here we are using MySQL database.

→ we have to select the version and templates

→ Now give name to our database server and also give credentials like username and password.

After that add database instance size or give database instance type .

→ Now add to Database

→ Now fill up the option for connectivity.

→ Select the authentication part

→ create database in Additional configuration.

→ As you can see out database in launched successfully

→ Here we did both things the EC2 with httpd service started and the RDS instance for DataBase.

Now access the wordpress from the browser by giving IP address of your webserver

http://<ip_address of your ec2 instance>/wordpress/

Use your database name , database username , database password and database endpoint

  • Database host name we can found in RDS service. In RDS service click on our database server and there is an one option that is connectivity and security in that we found the endpoint it means the database host.

Here we have to create one file in /var/www/html folder having name wp-config.php and copy the code given in that block and paste on that file. And then press on Run the installation option and it ask for authentication and we can access the wordpress.

Task Done successfully

Hope it will help you to understand the concepts

Thank You !

--

--