WordPress App backed with the power of RDS to provide high availability MySQL database
In this article, we are going to create a great setup over AWS cloud and with its amazing services.
🔅 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.
We will create the setup with step by step procedure.
Step 1: Configure RDS for providing MySQL database service to our WordPress App.
a). Go to AWS RDS service
b). Creating the Database
- we don’t want that any charges implemented on this experiment!!!
- Since we have opted for free tier, so only db.t2.micro size available.
- We can create our own customized VPC as well. Also the public access is allowed in order for testing, but in real time we need to customize it.
After some minutes, it will be in Available state .
c). Try to connect to this database
- For this, we need to install mysql first in the EC2 instance.
check the connection, using command: “mysql -h endpoint_url -u username -p”
We can create databases, table etc to customize our database.
Step 2: Configuring WordPress
To configure WordPress, we need to first install
- php (version 7.4 or more)
Lets install them one by one,
Commands to be used are :
httpd: “yum install httpd”
- “yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm ”
- “yum install https://rpms.remirepo.net/enterprise/remi-release-8.rpm”
- “yum install php:remi-7.4”
php-mysqlnd : “dnf install php-mysqlnd”
a). To setup WordPress, we need to download the zip file first.
command: “wget https://wordpress.org/latest.tar.gz”
Now, we will unzip this file.
command: “tar -xzvf latest.tar.gz”
Transfer these files to the document root.
command: “rsync -avP ~/wordpress/ /var/www/html/”
Create a folder for the data that will be uploaded by the users.
At last update the Apache permissions to the WordPress files
- Now Restart the httpd service, using command: “systemctl restart httpd”
c). Accessing the WordPress, through the WordPress
To access the WordPress, use the public IP of the EC2 instance.
d). Configure WordPress now
Ohh …..oh, we need to configure it manually!!!
After creating the file, wp-config.php we get the installation page
Yeahhhh!! we have successfully Installed it :)
After some customization, my blog site is — — — — ->
In this, I came to know about many concepts of Databases, their connections and how the back-end services are working.🤩
Further I have some plans to Enhance this website, with more Interesting services of AWS. Stay Tuned…..😌😌
💫 Keep Learning, Keep Sharing💫