Launching WordPress and Integrate it with Amazon RDS.

Naveen Pareek
5 min readSep 7, 2021

--

Here we launching a WordPress site on EC2 instance and connect it with Amazon RDS.

WordPress

WordPress is a free and open-source content management system (CMS) written in PHP and paired with a MySQL or MariaDB database. It contains plugin architecture and a template system, so you can customize any website to fit your business, blog, portfolio, or online store. 42% of the web is built on WordPress.

Amazon RDS

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.

With Amazon RDS for MySQL, we get automated backup and recovery so that you won’t lose data in the event of an accident; regular updates and patches, keeping your database secure and performant and easy installation with smart default parameters.

Now, let's come to the task description.

Task Description

🔅 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.

Let's Start….

As initially, we have to launch an ec2 instance. So here, we launched an ec2 instance named “AWS-Task18-wp”.

Now, connect to this ec2 instance using Putty and then configure the necessary programs in it. Such as Apache-webserver, PHP, WordPress, MySQL.

First, install httpd for configuring the webserver.

As, we need to deploy WordPress, so to that install PHP. To install PHP, we’ve to use “amazon-linux-extras”.

With Amazon Linux 2, we can use the Extras Library to install application and software updates on your instances. These software updates are known as topics.

“amazon-linux-extras install php7.4" :- this cmd used to install php in ec2-instance

After installing PHP, now this time we need to download the WordPress file using wget command. And, then untar the downloaded file in the respective directory.

Now, copy all the WordPress files in the document root directory of Apache Web Server. And, then start the httpd service.

As we see MySQL is not installed in the instance. So, we need to install the MySQL application.

Now, its time to launch the MYSQL database using Amazon RDS

Here, I'm showing steps for launching Amazon RDS using pictures.

select required database engine and creation method
select MySQL version and templates as per use-case
Choose respective VPC and security group and launch database in the private subnet.
Here, set some credentials for the database.
The final step to creating a database service

After successful creation of database service. Now, connect this database with ec2-instance using the given database endpoint. Such as,

“mysql -h endpoint -u username -p” :- this is the command to connect mysql with any instance.

After doing all these, now it's time to connect Amazon RDS with WordPress as its backend database server.

Now, We will connect RDS with WordPress:

Go to Configured EC2 instance and Copy the Public IP Address.

Then go to http://<public-ip>/wordpress/wp-admin/setup-config.php and fill in the details after clicking on Let’s go!

Fill in Your Details, As Username, Password, and Endpoints of RDS Instance in Host. and Submit.

After that, it will Open the WordPress Configuration File, which we have to copy in the wp-config.php file. We see the instruction on Page.

After Saving the File, Go to Browser Page and Click on Run The Installation.

The next Page will ask you for Your WordPress account details:

Fill in Your Details and Click on install WordPress.

One Confirmation Page will display:

After that, log in with the Account Credentials that you set up for WordPress Account and One Dash-Board Page will display like:

Dashboard of WordPress Application

To display your newly created blog site, just copy the page URL and paste it in the browser search bar.

Finally, Task is Completed Successfully!!!

Now You can modify your site as you want and behind the scene data store in AWS RDS…

Thank You!

Keep Learning & Sharing…

If this article is useful for you then don’t forget to press the clap 👏 icon and also follow me on medium for more such amazing articles.

Leave a comment if you have any doubts or you can connect me on LinkedIn.

--

--

No responses yet