AWS Relational Database connectivity to Native Applications

Kalla kruparaju
6 min readJul 24, 2021

--

Hello techies !!!

In this article article i will give overview how to connect the Aws Relational Database connectivity to our native Application.

Launched an ec2 instance and configured instance with apache webserver, deploying wordpress php application in the ec2 instance and configure the MySQL Database server which stores the backend data at the backend setup using the MySQL Database Server using the AWS RDS server and connected the MySQL database server with the wordpress application using the endpoint connection of the MySQL server

1.Launching ec2 instance in the Aws Cloud

you can see the no instances are running in the Ec2 service now we provision the instance with the following steps

I am launching the one instance using the amazon linux ami, choosing the t2.micro instance type in the default vpc in the mumbai region ap-south-1 and in the subnet ap-south-1a attaching the default storage of 8gb disk added the tag to the instance as wordpress and allowing the all traffic and launched the instance with the existing key

Now you can see that one instance is successfully launched with the tag name wordpress in the subnet ap-south-1a

2.Launching the database in the aws Cloud using the RDS service

You can see that no database instance are available let’s launch the database

I am choosing the standard create method and launching the database with the MySQL database engine

Launching the MySQL engine with the version 5.7.30 which is capable with my wordpress php application choose the version as per your requirement launching the database instance with the free tier where i can launch the instance with the t2.micro type only

Added the tag wpdatabase to the database for authentication added the user name admin and password to authenticate

I am launching the database with the free-tier so i can use only t2.micro instance type only

Launching database in the default vpc of the ap-south-1 in the subnet ap-south-1a where i launched the instance for the wordpress where not defining the public access

choosing the existing security groups and added the default security group and security of the instance of the wordpress and going with database authentication with the password authentication which is given above

Finally database is configured successfully let’s connect the database with the wordpress php application.

Login in to the wordpress instance to configure the webserver, php and finally launched the php application and connect the application with the backend database server to store the data of the wordpress application

Installing the apache webserver to host the our php application

Installing the mysql in the wordpress instance connect the rds myql database with the wordpress application

Login instance with the endpoint host of the rds mysql and with the username and password

by default wordpress won’t create any database we have to create the one database to the wordpress application the store the data in the database

WordPress is an application written in PHP so we are the enabling the php with version 7.2 in the wordpress instance

installing the dependencies of the php let’s check the version of the php

you can see that php is successfully installed with the verison 7.2.34

Let’s download the wordpress application to deploy it

Extracting the tar file of wordpress which is downloaded previous

You can see that wordpress application is successfully extracted and moving the application files to root folder of the apache webserver to host the application and Changing owner of webserver root folder wordpress. we copied one file wp-config.php where worspress will take the information of the database which is launched previous let’s added the details of the database server in the wordpress config file wp-config.php

update database name we created which is wordpress. database user
is admin and password I gave and Host is the Endpoint in the
Connections and Security tab of RDS Service

starting the services of the httpd and enabling the services permanently if you started the service of the httpd then restart the service of the httpd

Accessing the wordpress Application

Fill the details and set the password and then Install

Now WordPress Installed and it will redirect to login page of the wordpress and login with your credentials

Yeah you now finally successfully login to your wordpress application

Now you see that data of the wordpress frontend application stored by the backend database Mysql

Thank’s for reading for more technical releated blogs follow me in medium or send me invitation in linkedin

--

--