Day 45 Deploy Wordpress website on AWS

π οΈ 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
Click on "Create database."
Choose "MySQL" as the database engine.
Select the desired version and template (choose the "Free tier" if applicable).
Configure the instance details, including DB instance identifier, master username, and password.
Set up additional configurations such as DB instance size, storage, and networking.
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
Go to the AWS Management Console.
Click on "Services" and select "EC2" under the Compute category.
Step 2: Launch a New EC2 Instance
Click "Launch Instance."
Choose an Amazon Machine Image (AMI) β select an image that suits your requirements.
Select an instance type, configure instance details, storage, and add tags as needed.
Configure security groups to allow traffic on port 80 (HTTP) and port 443 (HTTPS).
Review your configurations and launch the instance.

Task-03: Install and Configure WordPress
Step 1: Download and Install WordPress
SSH into your EC2 instance.
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
- Create a WordPress configuration file:
cd /var/www/html/wordpress
sudo cp wp-config-sample.php wp-config.php
- Edit the configuration file with your RDS database details:
sudo vim wp-config.php
- 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
Open your web browser and navigate to your EC2 instance's public IP or domain.
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




