Task-18 Integrate WordPress with AWS RDS

Mohammed Abdul Basith
5 min readJan 12, 2022

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

Step 1

Let’s quickly launch the instance :

Finally, launch the instance after attaching the Key pair.

Now you can use Public IP address any Key to connect this Instance. You can use Putty(Recommended) or CLI Browser provided by Amazon to Connect Instance.

But here we use CLI Browser:

Lets go for Next to Configure the instance as Apache Webserver:

Step 2

Let’s quickly Configure it:

🌀 Install Apache Web Server

# sudo su -

# yum install httpd -y

🌀 Then we are Starting Webserver and Enable it Permanently.

# systemctl start httpd

# systemctl enable httpd

Step 3

# amazon-linux-extras install -y php7.2

🌀 After that download WordPress file!

# wget http://wordpress.org/latest.tar.gz

🌀 After download the “TAR” file “UNTAR” it.

# tar -xvzf latest.tar.gz

🌀 Next you see “wordpress” name dir come up. So now you can copy all Content inside “wordpress” folder to Document Root “/var/www/html”.

cp -rf wordpress/* /var/www/html

🆘 Note: Make Sure were you download your “tar” file and where you “Untar” it.

Step 4

Here is “Endpoint” of this DB Instance using this WordPress Application will connect to it.

Here this DB Instance is not Having any Internet Access, It can Only connect to Subnets inside VPC. No Public Accessibility!

Step 5

Go to the EC2 Instances page and find your instance. In the Description below, find the Public DNS (IPv4) of your instance.

Enter this IP Address into your web browser. Next Step -> “let’s go”.

Provide Following Information:

-Database Name: Provide Name of Database which created at time of launching DB!

- Username: The username you given while launching DB Instance!

- Password: Provide Password!

- Database Host: Provide the ENDPOINT which you get from “wordpress-db-1”!

- After Submit these.

🔅 Copy paste these Code file “wp-config.php”.

Put copied code in “/var/www/html/wp-config.php” at EC2 Instance where WordPress is deployed.

🆘 Note: “Please Use Putty while copy and paste these code to ‘wp-config.php’. Because if using CLI browser it will provide extra spaces unnecessarily and it will not work and give error!”

# vim wp-config.php

Now our WordPress is running on the AWS using AWS RDS as a service and in the backend it is using MySQL.

- Provide Following Details and Install WordPress! After Login with the credentials and Login to WordPress!

It appears as below …

Task Completed

Thank You

#vimaldaga #righteducation #educationredefine
#rightmentor #worldrecordholder #linuxworld
#makingindiafutureready #righeducation #arthbylw
#php #apache #wordpress #aws #rds #mysql #rdbms

--

--