Configuring WordPress on AWS EC2 Instance with AWS RDS.

Configuring WordPress on AWS EC2 Instance with AWS RDS.

AWS TASK:-

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 set up a MySQL server using AWS RDS service using Free Tier.

  • Provide the endpoint/connection string to the WordPress application to make it work.

Let's Start:-

Creating Security Groups for Instance and Database:-

Instance SG

sg instance -1.jpg

sg instance -2.jpg

sg instance -3.jpg

Database SG

sg db -1.jpg

sg db -2.jpg Here in the Inbound Rules , we have given Security Group of the instance so that only instance can connect with Database.

Creating an EC-2 Instance:-

creating instance-1.png

creating instance-2.jpg

creating instance-3.jpg

creating instance-4.jpg

Creating Database:-

creating db-1.jpg

creating db-2.jpg

creating db-3.jpg

creating db-4.jpg

creating db-5.jpg

creating db-6.jpg

creating db-7.jpg

creating db-8.jpg Here we give the Security Group created earlier.

creating db-9.jpg

creating db-10.jpg

Configuring Instance:-

Installing HTTPD and starting it's services:-

yum install httpd -y
systemctl start httpd
systemctl enable httpd

configuring instance.jpg

configuring instance-1.jpg

Installing PHP:-

amazon-linux-extras install php7.2

configuring instance-2.jpg

Installing and configuring MYSQL:-

yum install mysql

configuring instance-3.jpg

configuring instance-4.jpg

Downloading Wordpress:-

wget https://wordpress.org/wordpress-5.4.4.tar.gz

configuring instance-5.jpg

To extract the files use:-

tar -xzvf wordpress-5.4.4.tar.gz

configuring instance-6.jpg

Now move the Wordpress files to the /var/www/html/ directory:-

mv wordpress/* /var/www/html

configuring instance-7.jpg

Now change the ownership of the files to root :-

chown root:root -R /var/www/html/*

image.png

Now restart the httpd service using:-

systemctl restart httpd

wp -1.jpg So here our Wordpress started.

Configuring Wordpress:-

wp -1.jpg

wp -2.jpg

wp -3.jpg

wp -4.jpg

wp -5.jpg

So finally our task is complete!!

All thanks to Vimal Daga sir for providing us this knowledge.

Thank you