Website deployment on AWS

Abhishek Prasad Kesare
4 min readApr 28, 2021

--

setup WordPress application on aws and attaching the RDS as Database

Hello Guys, I am back once again with another new application on the cloud and mini-project for you

Today we are going to launch AWS ec2 instance setup environment for WordPress and then launch the Amazon RDS service to connect both and host a website

What is RDS?

RDS is a service provided by the AWS cloud. This is a relational database service with many features like it will provide autoscaling, IOPS speed, migration facilities, and many more. You have many other types of databases in this service like MySQL, oracle, maria, aurora, etc.

This much knowledge is efficient let's jump to practical directly

First, launch an aws instance, I am considering that this you all know, After launching the instance first we need to install webserver software called httpd

httpd installation
yum install httpd -y

now we have to set up WordPress application to do so first we should have PHP because WordPress has dependencies for PHP so let’s install it first

sudo amazon-linux-extras install php7.3

Now we have to install a MySQL agent so that we can connect our database later to this instance.

yum install mysql 

The above command will install MySQL agent software.

Now we have to install WordPress application

wget https://wordpress.org/latest.tar.gz

This command will install the tar file of WordPress application so we have to extract this to extract we have command in linux

tar -xvzf latest.tar.gz

Now as you have installed the software copy this software to /var/www/html you can below commands

cp wordpress /var/www/html

Now Let’s jump to main part; create the RDS service

Go to the amazon portal search for RDS service and click on create the database

select the type of database you want, give the password and name of the database, and the database user also further specification according to your requirement

Note: The security group used for the ec2 instance and database must be the same. if your database has no connectivity to the public world

Now let's connect the database with the ec2 instance and create the database for the storage of data of the WordPress application

mysql -h <endpoint of database> -u <username> -P <port number> -p<password>

After successful login create a database inside the RDS

MYSQL CREATE DATABASE <databasename> ;

Now let's move towards httpd server to make our website visible

first, we have to restart the httpd server so that changes made should be visible to all

systemctl restart httpd

and now go to public IP address of your ec2 instance and type given URL

https:<publicip>/wordpress/wp-admin/setup-config.php

Now click on Let’s go

fill information about your database

Now copy the content and create a file called wp-config.php in the /var/www/html folder and again restart the server so that this will work fine

Now fill the information about your site and login id and password

after installation login to your website, you will see the pages below

And this comes end for today see you in another one

you can connect me on LinkedIn

--

--

Abhishek Prasad Kesare

Data science, , cloud computing, Artificial Intelligence, Cybersecurity,tech-blogger