WordPress on the top of EC2 instance and AWS RDS

There are few steps you need to follow to Launch WordPress on the top of AWS EC2 instance and AWS RDS for databases :

1. Create an AWS EC2 instance

2. Configure the instance with Apache Webserver.

3. Install PHP

4. Download PHP application name “WordPress”.

5. Setup a MySQL server using AWS RDS service.

6. Provide the endpoint/connection string to the WordPress application.

1. Launch EC2 instance :

So first we need to launch EC2 instance and in that instance we will configure our webserver.

For this, to check how to launch instance in AWS step by step, go through my this blog:

AWS — Create EBS, Launch instance and attach

2. Configure the instance with Apache Webserver :

Install apache web server using this command : yum install httpd

3. Install php :

Because WordPress is a website written in php, we need to install php. And for this we need to install php version 7.4 that is compatible with wordPress version 5.6.

Command To install php 7.4 : amazon-linux-extras install php7.4

4. Download php application name “WordPress” :

> We can download wordpress from github using this link :
https://github.com/WordPress/WordPress

> Copy the folder from windows to EC2 instance using WINSCP.

> And then copy the wordpress page to /var/www/html directory.

command to copy : cp -rvf /home/ec2-user/WordPress-master/* /var/www/html/

> Start httpd service using command : systemctl start httpd

Here you can see service has been started.

> Now browse for ip of your instance on any web browser.

<EC2-instance-ip>:80/index.php

> WordPress page will come up and it will ask for database name, username, password , and database endpoint.

5. Setup a MySQL server using AWS RDS service:

As wordpress stores data at the backend in MySQL Database server. Therefore, we need to setup a MySQL server using AWS RDS service using Free Tier.

These are the few steps to setup MySQL server in AWS:

1. Go to services and select create database option.

2. Select mysql

3. Select free tier, admin name and database name then give password for database.

4. select Instance size, storage, Network, VPC, subnets, according to your need and create.

6. Provide the endpoint/connection string to the WordPress application :

> Now check the endpoint of your database in database instance.

> Enter the database name, database username , password and database end point in wordpress.

> Create/edit file in /var/www/html with filename — wp-config.php

command : vim wp-config.php

> In that file, copy the text given in wordpress.

> After copying, select “Run the installation”

> Then provide information needed and install wordpress.

> Use your username and password provided to login.

Now you can create your own websites and blogs on WordPress!!

DONE!!!!

That’s all we need to do.

Now you can check your website using instance IP and port 80 on any web browser.

<instance-ip>:80/index.php

Your Webpage will come up.

I Hope You Like It…

Thank You For Reading…

If you like it please clap it.😁🤗

Connect with me on LinkedIn | GitHub

Lifelong learning technologies