MySQL server using AWS RDS service

MySQL server using AWS RDS service

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.

Prerequisite

  • You should have your AWS account.
  • Basic knowledge of Linux OS.
  • Basic knowledge of MySQL

What is RDS?

Amazon Relational Database Service (Amazon?RDS) makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while automating time-consuming administration tasks such as hardware provisioning, database setup, patching and backups.

What is WordPress?

WordPress is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database. Features include a plugin architecture and a template system, referred to within WordPress as Themes.

Step 1 :- First create the MySQL RDS.

  • In Database click on RDS.

No alt text provided for this image

  • Click on Create database.

No alt text provided for this image

  • Select MySQL

No alt text provided for this image

  • select latest version of MySQL and free tier so that they will not charge any cost.

No alt text provided for this image

  • Name your database and set username and password for your database

No alt text provided for this image

  • Leave rest of setting default. and In the Public access select yes otherwise you won't be able to connect to WordPress.

No alt text provided for this image

  • Choose the security group if you have already created any , otherwise you can create new one.
  • Now click on create database.

No alt text provided for this image
No alt text provided for this image

Step 2:- Launch an ec2 instance and configure WordPress.

  • Select the instance and click on connect to connect to your ec2 instance.

No alt text provided for this image
No alt text provided for this image

  • run?"sudo su - root"?to become root user so that you can run all the command with root privilege.

No alt text provided for this image

  • To setup the WordPress we need to install some software.
  • "yum install httpd -y"?and?"yum install mysql -y"?to install httpd and mysql.

No alt text provided for this image
No alt text provided for this image

  • Run?"amazon-linux-extras enable php7.4"?command to get command to install php.

No alt text provided for this image
No alt text provided for this image

  • Run those two command given in the above image to install php.

No alt text provided for this image

  • Now go to the official site of WordPress https://wordpress.org/download/ and copy the download link.

No alt text provided for this image

  • go to the?"cd /var/www/html/"?folder.
  • Run the?"wget https://wordpress.org/latest.tar.gz"?command to download the wordpress software.

No alt text provided for this image

  • and?"tar -xf latest.tar.gz"?to unzip the Wordpress software.

No alt text provided for this image

  • Enable the httpd service. and enter your public IP of ec2 instance on browser followed by your wordpress folder?"publicIP/worpress".

(First EDIT inbound rule)

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image


Step 3 :- Check your?RDS MySQL?database connectivity.

  • Copy your database endpoint
  • Run the below command to connect your database. enter your correct?endpoint?, user and password in this command.

So as you can see we have successfully connected to the mysql database now here you can run mysql command to check database and tables.

Thank You for reading !!!
Keep Learning and Keep Sharing !!!


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

Abhinav Singh的更多文章

社区洞察

其他会员也浏览了