Setup WordPress and RDS database over AWS
Vivek Sharma
RedHat Certified in Containers and Kubernetes(EX180) ||Arth || Aspiring DevOps Engineer || Python || Docker || Ansible || Jenkins || Kubernetes || OpenShift || Terraform || GitHub || AWS || AZURE
ARTH Task 18
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.
STEP 1: Creating AWS EC2 Instance
To launch ec2 instance we have to navigate to EC2 dashboard and click on launch instance . Then we have to give information about the instance like image , type of instance, security group, volumes etc. After that an instance will be launched, visible on dashboard.
STEP 2: Configure the instance with Apache Webserver.
We can directly login to the instance using web browser or use putty. After login use the following commands to configure apache webserver.
#yum install httpd -y => To install apache webserver
#systemctl start httpd => To start apache webserver
#systemctl status httpd => To view status of httpd
Create a webpage - index.html
View webpage from browser -
STEP 3: Download php application name "WordPress"
For installing WordPress we should have php installed in our system with version 7 or above.
#amazon-linux-extras install php7.3 => install php7.3
# php -v => To see php version installed
Now to install WordPress on our instance
#wget https://wordpress.org/latest.tar.gz => download the WordPress software
#tar -xzf latest.tar.gz => unzip installation file
Now restart the httpd service so that server can pick up the changes
#systemctl restart httpd
Now we can see the welcome page WordPress when we visit to this url https://65.1.3134.132/wordpress then we shall be redirected to https://65.1.134.132/wordpress/wp-admin/setup-config.php
STEP 4: setup a MySQL server using AWS RDS service using Free Tier
To setup a MySQL server navigate to AWS RDS service and click on create database option then fill all the required fields like user, password, name of database, choose and free tier in templates .
When database is created you can see details of the database
STEP 5: Provide the endpoint/connection string to the WordPress application to make it work.
In the image above we can see the endpoint URL. We have to put this URL ,user name, password and our database name in the page we obtain after step 3.
After that we can see a page like given below
Copy the content from above page , create a file "wp-config.php" in the /var/www/html/wordpress folder then copy the content to that file. At last click on Begin Installation to start installing WordPress . When the process of installation ends you will see the famous 5 minute WordPress installation process
Fill in the details and proceed. You Will see a success page like this one-
Finally WordPress is installed you can login with the given email and password and you can see the dashboard of dashboard of WordPress.
THANK YOU FOR READING..............