WordPress Deployment On EC2 Instance And Use RDS For Database

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
No alt text provided for this image

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

No alt text provided for this image
  • Connect with putty and setup WordPress On this instance -
No alt text provided for this image
  • 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

No alt text provided for this image
  • Make executable this file and run this file -
  # chmod +x install
  # ./install

No alt text provided for this image
No alt text provided for this image
  • Check WordPress is running or not ( In my case it is running file if WordPress site is not showing then restart httpd service ) -
No alt text provided for this image

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

No alt text provided for this image
  • EndPoint URL is "testing.cxcaxlu9lsw3.ap-south-1.rds.amazonaws.com" -
No alt text provided for this image

SetUp WordPress -

  • Give Info to WordPress -
No alt text provided for this image
  • Copy this code -
No alt text provided for this image
  • Put copied code in "/var/www/html/wp-config.php" at EC2 Instance where WordPress is deployed -
No alt text provided for this image
  • Now Install WordPress -
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
Our WordPress Site is successfully deployed. Now Task is competed.


要查看或添加评论,请登录

Govind Bhardwaj的更多文章

社区洞察

其他会员也浏览了