Configuring WordPress using ec2, RDS.

Prudhvi Kumar Danapana
3 min readSep 18, 2023

WordPress is a popular and user-friendly platform for building websites and blogs. It’s like a toolbox for creating and managing your website without needing to know how to code.

Imagine WordPress as a blank canvas where you can paint your website. It provides you with pre-made templates (called themes) that determine how your site looks. You can also add different tools and features to your site by installing plugins, kind of like adding apps to your phone.

Step1: Creating an ec2 instance:

Go to the EC2 Dashboard.

Click on the “Launch Instance” button.

  • Choose an Amazon Machine Image (AMI) for your EC2 instance. You can use Amazon Linux or any other suitable Linux distribution.
  • Select an instance type. You can start with the t2.micro instance, which is eligible for the AWS Free Tier.
  • Configure the instance details as per your requirements, including network settings, security groups, and tags.
  • Review the instance configuration and launch it, creating or selecting an existing key pair to connect securely to your instance.

Step2: Connect to Your EC2 Instance:

Note: Here the ip is not the same everywhere as you see in this entire article. It keeps on changing since it is a public ip and we havent fixed that ip.

Step 3: Install Apache web server with php and WordPress:

Apache Installation with status checked
php and mysql installation and configuring wordpress location for page access

Step 4: Set Up AWS RDS MySQL Database

search for rds services
Click on create database
Select on mysql database
Select free tier and provide the security credentials asked for like name, username and password
To establish connection with ec2

Step5: Configure WordPress to Use RDS

  • Now, lend towards ec2 instance and run the cmd below
  • cmd: vi /var/www/html/wordpress/wp-config.php
  • In that configuration part edit these details. These are the details we used while creating rds service.

define(‘DB_NAME’, ‘your-db-name’);
define(‘DB_USER’, ‘your-db-username’);
define(‘DB_PASSWORD’, ‘your-db-password’);
define(‘DB_HOST’, ‘your-rds-endpoint’);

  • rds endpoint link can be fetched in rds database dashboard.

Step 5: Finish WordPress Installation:

Enter the details to connect
  • In the next page the page asks for site title, username, password etc.
  • Then click on install. WordPress would be successfully installed.
  • Now you can create post, blogs etc.

Thank you🤗🤗

--

--