Deploy WordPress with AWS RDS.

Swarnim Kashyap
5 min readJul 16, 2021

--

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

WHAT IS AWS RDS?

Amazon Relational Database Service (Amazon RDS) makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while automating time-consuming administration tasks such as hardware provisioning, database setup, patching and backups. It frees you to focus on your applications so you can give them the fast performance, high availability, security and compatibility they need.

Amazon RDS is available on several database instance types — optimized for memory, performance or I/O — and provides you with six familiar database engines to choose from, including Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle Database, and SQL Server. You can use the AWS Database Migration Service to easily migrate or replicate your existing databases to Amazon RDS

What is WordPress?

The simplest answer is this:

WordPress is your website’s operating system.

Think of it this way, just like your smartphone needs either iOS or Android to work, your “smart-website” needs WordPress. While WordPress is certainly not the only website operating system around, it is the unquestionable leader in this space. At the time of writing, WordPress runs 32% of all websites. Again, that is *all* websites

Steps 1:

Launch an EC2 instance For Deploying WordPress.

Steps 2:

Connect to EC2 Instance using Putty and install necessary libraries.

dnf update -y
dnf install httpd -y
dnf install wget
vim -y
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf module install php:remi-7.4
dnf install php-mysqlnd -y
systemctl start httpd

dnf update -y (To check the latest update of packages)

dnf install httpd -y (To install Apache webserver)

dnf install vim wget -y (To install vim editor and wget cmd)

dnf module install php:remi-7.4 (To install PHP)

dnf install php-mysqlnd (To install MYSQL Server)

wget htttps://wordpress.org/latest.tar.gz (It will download a installation file on wordpress in ZIP format)

tar xf latest.tar.gz -C /var/www/html (It will unzip wordpress installtion file and copy it to /var/www/html/ directory)

systemctl start httpd (To start Apache Webserver)

Verify that your apache is working or not.

Enter your Public IP to Web browser.

Step 3:Launch RDS database For WordPress

  • Open Amazon RDS and click on Create Database
  • Select MySQL as database type
  • In the Templates section, choose the Free tier.
  • DB instance identifierdefault
  • Master usernameadmin
  • Master password — Choose a password.
  • Confirm password — Confirm the password
  • Availiability Zone — us-east-1
  • Initial Database Name — database-2

👉 Click on Create Database

👉 Select MySQL

👉 Select Version & Template as Free Tier

👉 Click On Create DataBase.

👉 Here we see our RDS DataBase is successfully created.

👉 Now if we wants to connect our database so we need the EndPoint URL.

👉 Go to your instance and type this command to connect.

mysql -h endpoint url -u admin -p

Final Step: Let’sConnect to WordPress.

wordpress/IP

👉 Provide Databse Name,UserName,Password,Endpoint Url.

👉 Click on Run the installation.

Yeah WordPress with MySQL Connection established successfully.😍

TASK COMLETED 😁

Thank you ! if you like this article then please share this post

You can also follow me on my linked in profile by clicking on following link.

https://www.linkedin.com/in/swarnim-kashyap-b99405185/

--

--

Swarnim Kashyap

RedHat Certified Engineer| DevOps Enthusiast | Big Data Hadoop | RedHat Linux 8| AWS Cloud | GCP | Azure Cloud |GIT & GitHub |Python