WordPress Deployment On EC2 Instance And Use RDS For Database
Hello Guys ,
In this article we will deploy WordPress on AWS EC2 Instance and we will use AWS RDS Service For Database . In AWS RDS We will use MySQL Database .
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.
Task Steps -
- For this practical I have my windows system and On my windows system AWS client program is already installed -
# aws --version
Deploy WordPress On EC2 Instance -
- Launch EC2 Instance ( "sg-001cad109816edeee" is allowing all traffic ) -
# aws ec2 run-instances --image-id ami-08e0ca9924195beba --instance-type t2.micro --key-name hello --security-group-ids sg-001cad109816edeee
- Connect with putty and setup WordPress On this instance -
- Run below command to setup wordpress - ( I have these command in a file "install" now I will run this file "install")
# yum install httpd -y # systemctl enable httpd --now # amazon-linux-extras install php7.3 -y # wget https://wordpress.org/latest.tar.gz # tar -zxf latest.tar.gz
# cp -r wordpress/* /var/www/html/ # systemctl restart httpd
- Make executable this file and run this file -
# chmod +x install # ./install
- Check WordPress is running or not ( In my case it is running file if WordPress site is not showing then restart httpd service ) -
Create MySQL Database on AWS With RDS Service -
- Run below command to create Database ( "mytask18" )Cluster using AWS RDS Service
# aws rds create-db-instance --availability-zone ap-south-1b --db-name mytask18 --db-instance-identifier testing --vpc-security-group-ids sg-001cad109816edeee --engine mysql --engine-version 5.7.31 --master-username admin --master-user-password redhatadmin --publicly-accessible --db-instance-class db.t1.micro --allocated-storage 20
- EndPoint URL is "testing.cxcaxlu9lsw3.ap-south-1.rds.amazonaws.com" -
SetUp WordPress -
- Give Info to WordPress -
- Copy this code -
- Put copied code in "/var/www/html/wp-config.php" at EC2 Instance where WordPress is deployed -
- Now Install WordPress -
Our WordPress Site is successfully deployed. Now Task is competed.