- Create an AWS EC2 instance
- Configure the instance with Apache webserver
- Download php application name "WordPress".
- Setup a MySQL server using AWS RDS service using Free Tier as a backend
- Provide the endpoint/connection string to the WordPress application to make it work
- AWS Account
🔶 We need to launch an EC2 Instance on AWS which we will use to configure Apache Webserver and run WordPress.
🔶 Click on
🔶 Select 'Amazon Linux` as a Instance Flavor.
🔶 Click on
Add Rule. I will allow
All traffic to avoid any firewall issue. Then click on
Review and Launch.
key pair then Instance will launched successfully.
🔶 Click on
Instance ID. You will get all the details of your created instance.
Now you can use
Public IP address any Key to connect this Instance. You can use Putty(Recommended) or CLI Browser provided by Amazon to Connect Instance.
Lets go for Next to Configure the instance as Apache Webserver:
🔶 Here we are going to configure the
Apache Web Server in Amazon Linux 2 Instance.
🔶 To run WordPress, we need to run a web server on our EC2 instance. The open source Apache web server is the most popular web server used with WordPress.
🔶 Install Apache Web Server.
sudo su - yum install httpd -y
🔶 Then we are Starting Webserver and Enable it Permanently.
systemctl start httpd systemctl enable httpd
🔶 WordPress is a php Application, let’s install
🔶 With Amazon Linux 2, you can use the Extras Library to install application and software updates on your instances.
amazon-linux-extras install -y php7.2
🔶 After that download WordPress file!
🔶 After download the "TAR" file "UNTAR" it.
tar -xvzf latest.tar.gz
🔶 Next you see
dir come up. So now you can copy all Content inside
wordpress folder to Document Root
cp -rf wordpress/* /var/www/html
Make Sure where you download your
tar file and where you
🔶 Let’s now launch a MySql database using
🔶 Now click on
Launch Database. It will take around 10 minutes.
🔶 Go to the created EC2 Instances instance. In the Description below, find the
Public DNS (IPv4) of your instance.
🔅 Provide Following Information:
🌀 Database Name: Provide Name of Database which created at time of launching DB!
🌀 Username: The username you given while launching DB Instance!
🌀 Password: Provide Password!
🌀 Database Host: Provide the ENDPOINT which you get from "wordpress-database"!
🔶 Now our WordPress is running on the AWS using AWS RDS as a service and in the backend it is using MySQL.
Let's check from CLI.
# mysql -h <endpoint_url> -u <username> -p