AWS Relational Database Service With WordPress..
Hello Everyone…
Today I am here with a new article. Which is based on AWS Relational Database Service . In this article we are going to see what is AWS RDS, what is WordPress, and lots of interesting things …
So lets jump on our today’s interesting topic guys…
Problem Statement:
🔰 Create an AWS EC2 instance
🔰 Configure the instance with Apache Webserver.
🔰 Download php application name “WordPress”.
🔰 As wordpress stores data at the backend in MySQL Database server. Therefore, you need to setup a MySQL server using AWS RDS service using Free Tier.
🔰 Provide the endpoint/connection string to the WordPress application to make it work.
Before moving towards to our demo first we see the concepts related with demo i.e. RDS and WordPress.
Amazon RDS (Relational Database Service):
Amazon Relational Database Service (Amazon RDS) is a managed SQL database service provided by Amazon Web Services (AWS). Amazon RDS supports an array of database engines to store and organize data and helps with database management tasks, such as migration, backup, recovery and patching.
A cloud administrator uses Amazon RDS to set up, manage and scale a relational database instance in the cloud. The service also automatically backs up RDS database instances, captures a daily snapshot of data and retains transaction logs to enable point-in-time recovery. RDS also automatically patches database engine software.
To enhance availability and reliability for production workloads, Amazon RDS enables replication. An admin can also enable automatic failover across multiple availability zones with synchronous data replication.
WordPress:
WordPress is a free, open-source website creation platform. On a more technical level, WordPress is a content management system (CMS) written in PHP that uses a MySQL database. In non-geek speak, WordPress is the easiest and most powerful blogging and website builder in existence today.
According to usage statistics of content management systems now report that WordPress powers over 60 million websites, or 36% of all websites on the internet and over 60% of all websites whose content management systems are known.
Because WordPress is free and so easy to use, it has been widely adopted as the gold standard for website builders.
So Let’s Start Demo…
First create two security group one for RDS database and another one for backend instance.
While creating backend instance allow ssh and http port.
Now, create a Security group for RDS Database.
Here, I am adding a same security group which we have already created for backend server so that my RDS Database allow only to the backend server.
Now, we lunch a new EC2 instance.
Here we are using the Amazon Linux 2 AMI image for lunching instance.
Now use instance type having free tier eligibility.
Now, in configure instance details go to advance details and in user data add below code do run commands for installing wordpress.
After this I am adding the Security Group which we have already created for this instance.
Now launch the instance by giving some Tag and attaching a key.
Here we can see our instance launched successfully.
Now check the httpd service configured and running properly or not by using below command.
Command:
systemctl status httpd
Here, our httpd service running properly.
Now, let’s use the AWS RDS to create a Database.
First go to RDS service and select create database option .Here we are using MySQL database.
Now select version and template.
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 the storage.
Now, add the option for connectivity.
Now, create a database in additional configuration.
Now, add values in Backup option.
And last option that is maintenance keep it as it is and then select an option create database for creating the database.
Here, our database created successfully.
Now, let’s configure the wordpress application in our backend server. For that first step is download the software of wordpress in that ec2 instance.
After that extract this package of wordpress in /var/www/html folder by using below command.
Command:
tar -xzvf latest.tar.gz -C /var/www/html
Now, let’s check weather this software is extracted or not.
Here, wordpress extracted successfully.
Now, access the wordpress from the browser by giving IP address of that instance as shown in below.
<backend server_ip>/wordpress/wp-admin/setup-config.php
After we click on Let’s go option then it go to next page.
Here, we have to fill some credential related information and also we have to provide a endpoint that we get in RDS database.
After fulfilling all the requirements click on submit. After that it goes to the next page.
Here we have to create a file in /var/www/html folder having name wp-config.php and copy the code given in that block and paste it on that file. After that press on Run the installation option and it ask for authentication and then we can access the wordpress.
So, Here we have successfully done the task and create the database…
That’s All Guys…
Thanks for patient reading. See you soon with new article..
THANK YOU…