Skip to main content

Command Palette

Search for a command to run...

Day 45 Deploy Wordpress website on AWS

Published
β€’3 min read
Day 45 Deploy Wordpress website on AWS
K

πŸ› οΈ Exploring DevOps tools: Docker, Kubernetes, Jenkins, Terraform, and more. 🌐Let's connect, learn, and grow together.

Day 45 of #90daysofdevops

Hey Techies! Welcome to this blog

In this blog, we are going to start with Deploy Wordpress website on AWS

WordPress, the world's most popular Content Management System (CMS), can be seamlessly deployed on Amazon Web Services (AWS) for a scalable and reliable web experience. In this blog post, we'll guide you through the process of deploying a WordPress website on AWS, leveraging the power of Amazon EC2 for hosting and Amazon RDS for MySQL as the database backend.

Task-01: Create an RDS for MySQL Database

Before configuring the WordPress site, let's set up the MySQL database using Amazon RDS.

Step 1: Log in to AWS Management Console

Navigate to the AWS Management Console and log in to your AWS account.

Step 2: Access Amazon RDS

Click on the "Services" dropdown, select "RDS" under the Database category.

Step 3: Create a New RDS Instance

  1. Click on "Create database."

  2. Choose "MySQL" as the database engine.

  3. Select the desired version and template (choose the "Free tier" if applicable).

  4. Configure the instance details, including DB instance identifier, master username, and password.

  5. Set up additional configurations such as DB instance size, storage, and networking.

  6. Review your settings and click "Create database."

Step 4: Wait for RDS Instance to be Available

The RDS instance creation process may take a few minutes. Once it's available, note down the endpoint for future reference.

Task-02: Set Up Amazon EC2 Instance for WordPress

Step 1: Navigate to EC2 Dashboard

  1. Go to the AWS Management Console.

  2. Click on "Services" and select "EC2" under the Compute category.

Step 2: Launch a New EC2 Instance

  1. Click "Launch Instance."

  2. Choose an Amazon Machine Image (AMI) – select an image that suits your requirements.

  3. Select an instance type, configure instance details, storage, and add tags as needed.

  4. Configure security groups to allow traffic on port 80 (HTTP) and port 443 (HTTPS).

  5. Review your configurations and launch the instance.

Task-03: Install and Configure WordPress

Step 1: Download and Install WordPress

  1. SSH into your EC2 instance.

  2. Download and install WordPress:

 sudo apt-get update
 sudo apt-get install apache2 mysql-server php php-mysql libapache2-mod-php php-cli
 sudo service apache2 start
 sudo service mysql start
 sudo wget https://wordpress.org/latest.tar.gz
 sudo tar -xzf latest.tar.gz -C /var/www/html/

Step 2: Configure WordPress

  1. Create a WordPress configuration file:
 cd /var/www/html/wordpress
 sudo cp wp-config-sample.php wp-config.php
  1. Edit the configuration file with your RDS database details:
sudo vim wp-config.php
  1. Update the following lines with your RDS database details:
define('DB_NAME', 'your_database_name');
define('DB_USER', 'your_database_user');
define('DB_PASSWORD', 'your_database_password');
define('DB_HOST', 'your_rds_endpoint');

Save and close the file.

Step 3: Access WordPress

  1. Open your web browser and navigate to your EC2 instance's public IP or domain.

  2. Complete the WordPress installation by entering the required details.

That's it! You've just completed the task. πŸŽ‰

Thank you so much for taking the time to read till the end! Hope you found this blog informative and helpful.

Feel free to explore more of my content, and don't hesitate to reach out if need any assistance from me or in case of you have any questions.

Happy Learning!

~kritika :)

Connect with me: LinkedIn