<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ayesha</title>
    <description>The latest articles on DEV Community by Ayesha (@ayesha6565).</description>
    <link>https://dev.to/ayesha6565</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4270227%2Fbf976834-9005-4bfc-859b-59facfab55ba.jpeg</url>
      <title>DEV Community: Ayesha</title>
      <link>https://dev.to/ayesha6565</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ayesha6565"/>
    <language>en</language>
    <item>
      <title>Deploying a Highly Available 3-Tier WordPress Website on AWS</title>
      <dc:creator>Ayesha</dc:creator>
      <pubDate>Sat, 28 Nov 2026 07:04:56 +0000</pubDate>
      <link>https://dev.to/ayesha6565/deploying-a-highly-available-3-tier-wordpress-website-on-aws-8k1</link>
      <guid>https://dev.to/ayesha6565/deploying-a-highly-available-3-tier-wordpress-website-on-aws-8k1</guid>
      <description>&lt;p&gt;Deploying a production-ready WordPress site requires separating presentation, application logic, and data storage across isolated network layers. A Traditional 3-Tier Architecture on Amazon Web Services (AWS) achieves high availability, fault tolerance, and strict security boundaries by distributing resources across multiple Availability Zones (AZs).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.1 Project Overview&lt;/strong&gt;&lt;br&gt;
This architecture decouples the web application into three distinct tiers inside a custom Virtual Private Cloud (VPC):&lt;/p&gt;

&lt;p&gt;Presentation Tier (Public Layer): Houses the Application Load Balancer (ALB) and NAT Gateways across two Availability Zones to manage incoming internet traffic and outbound private subnet updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application Tier (Private Compute Layer):&lt;/strong&gt; &lt;br&gt;
Runs auto-scaled Amazon EC2 instances hosting the WordPress PHP application files inside private subnets, shielded from direct public internet access.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Tier (Private Storage &amp;amp; Database Layer):&lt;/strong&gt; Persists structured content in an Amazon RDS for MySQL database and synchronizes shared media uploads (wp-content) across all EC2 web servers using Amazon Elastic File System (EFS).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmr9gvvq8j93yi9qne3t9.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmr9gvvq8j93yi9qne3t9.webp" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.2 Networking Setup — Create a VPC with Public and Private Subnets&lt;/strong&gt;&lt;br&gt;
A well-segmented network ensures that databases and application servers never receive unsolicited external traffic.&lt;/p&gt;

&lt;p&gt;Create the VPC: Provision a custom VPC (e.g., WordPress-3Tier-VPC) with an IPv4 CIDR block of 10.0.0.0/16 and enable DNS hostnames.&lt;/p&gt;

&lt;p&gt;Attach an Internet Gateway (IGW): Create an IGW and attach it to the VPC to allow internet communication for public-facing components.&lt;/p&gt;

&lt;p&gt;Provision Multi-AZ Subnets: Create six subnets across two Availability Zones (us-east-1a and us-east-1b) to isolate each tier:&lt;/p&gt;

&lt;p&gt;Public Subnets (2): 10.0.1.0/24 (AZ-1) and 10.0.2.0/24 (AZ-2) for the ALB and NAT Gateways.&lt;/p&gt;

&lt;p&gt;Private App Subnets (2): 10.0.3.0/24 (AZ-1) and 10.0.4.0/24 (AZ-2) for WordPress EC2 instances.&lt;/p&gt;

&lt;p&gt;Private Data Subnets (2): 10.0.5.0/24 (AZ-1) and 10.0.6.0/24 (AZ-2) for RDS MySQL and EFS mount targets.&lt;/p&gt;

&lt;p&gt;Console Verification Checkpoint: Navigate to VPC &amp;gt; Subnets and verify that all six subnets display Available status with non-overlapping CIDR blocks distributed evenly across two Availability Zones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.3 Networking Setup — Create a NAT Gateway and Security Groups&lt;/strong&gt;&lt;br&gt;
Private EC2 instances still need outbound internet access to download WordPress core updates, plugins, and OS security patches without exposing inbound ports.&lt;/p&gt;

&lt;p&gt;Configure NAT Gateway &amp;amp; Route Tables:&lt;/p&gt;

&lt;p&gt;Allocate an Elastic IP and launch a NAT Gateway inside a Public Subnet.&lt;/p&gt;

&lt;p&gt;Create a Public Route Table routing 0.0.0.0/0 to the Internet Gateway and associate it with the public subnets.&lt;/p&gt;

&lt;p&gt;Create a Private Route Table routing 0.0.0.0/0 to the NAT Gateway and associate it with the private application subnets.&lt;/p&gt;

&lt;p&gt;Enforce Least-Privilege Security Groups: Chain security groups so each tier only accepts traffic from the tier directly above it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0ig9mbs4twnijsuuu77i.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0ig9mbs4twnijsuuu77i.webp" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Console Verification Checkpoint: In VPC &amp;gt; Route Tables, confirm the Private Route Table shows 0.0.0.0/0 -&amp;gt; nat-xxxxxxxx as Active, and review each Security Group's inbound tab to ensure source IDs (sg-xxxx) are referenced rather than open IP ranges.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.4 Database Setup — Create MySQL Database and EFS in AWS&lt;/strong&gt;&lt;br&gt;
To prevent split-brain media uploads or local state loss when scaling EC2 instances, both database records and uploaded assets must live outside the compute layer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Provision Amazon RDS (MySQL):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a DB Subnet Group spanning the two Private Data Subnets (10.0.5.0/24 and 10.0.6.0/24).&lt;/p&gt;

&lt;p&gt;Launch a MySQL RDS instance (enable Multi-AZ for production failover), disable Public Access, attach Database-SG, and set the initial database name to wordpress.&lt;/p&gt;

&lt;p&gt;Record the generated RDS Endpoint for WordPress configuration.&lt;/p&gt;

&lt;p&gt;Create Amazon EFS:&lt;/p&gt;

&lt;p&gt;Create a regional Elastic File System inside WordPress-3Tier-VPC.&lt;/p&gt;

&lt;p&gt;Configure Mount Targets in both Private Data Subnets and assign EFS-SG to each target.&lt;/p&gt;

&lt;p&gt;Note the File System ID (fs-xxxxxxxx) to mount /var/www/html across all web servers.&lt;/p&gt;

&lt;p&gt;Console Verification Checkpoint: In RDS &amp;gt; Databases, confirm the instance status is Available with Publicly accessible: No. In EFS &amp;gt; File systems, verify that both mount targets show Available lifecycle states.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.5 Compute Setup — Setting Up EC2 Instances and Application Load Balancer&lt;/strong&gt;&lt;br&gt;
With networking and storage ready, deploy stateless web servers behind a load balancer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Launch EC2 WordPress Instances:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Launch two Amazon Linux 2023 (or Ubuntu) EC2 instances inside the Private App Subnets (10.0.3.0/24 and 10.0.4.0/24) with WebServer-SG attached.&lt;/p&gt;

&lt;p&gt;Use EC2 User Data (or connect via AWS Systems Manager Session Manager) to install Apache/Nginx, PHP, the EFS mount helper (amazon-efs-utils), and WordPress:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsqauhjgmpfuf43jqr5ai.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsqauhjgmpfuf43jqr5ai.webp" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Configure wp-config.php with your RDS Endpoint, database name (wordpress), username, and password.&lt;/p&gt;

&lt;p&gt;Configure Target Group &amp;amp; Application Load Balancer:&lt;/p&gt;

&lt;p&gt;Create an Instance Target Group listening on HTTP port 80, configure the health check path (/ or /wp-admin/install.php), and register both private EC2 instances.&lt;/p&gt;

&lt;p&gt;Create an internet-facing Application Load Balancer across the two Public Subnets, attach ALB-SG, and forward port 80 traffic to your Target Group.&lt;/p&gt;

&lt;p&gt;Open the ALB DNS Name in a browser to complete the WordPress installation wizard.&lt;/p&gt;

&lt;p&gt;Console Verification Checkpoint: Open EC2 &amp;gt; Target Groups &amp;gt; Targets and verify both private EC2 instances report a Healthy status before accessing the ALB DNS URL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.6 Conclusion &amp;amp; Clean-Up&lt;/strong&gt;&lt;br&gt;
Implementing a 3-Tier WordPress architecture on AWS eliminates single points of failure while keeping critical database and file storage layers completely isolated from the public internet. Because WordPress state is offloaded to RDS and EFS, you can seamlessly attach an Auto Scaling Group to the private application tier to handle traffic spikes automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resource Clean-Up Checklist&lt;/strong&gt;&lt;br&gt;
To avoid ongoing AWS charges after testing this project, delete resources in reverse dependency order:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Compute &amp;amp; Load Balancing: *&lt;/em&gt; &lt;br&gt;
Delete the Application Load Balancer, delete the Target Group, and Terminate all EC2 instances.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Storage &amp;amp; Database: *&lt;/em&gt;&lt;br&gt;
Delete the Amazon EFS file system (after removing mount targets) and delete the RDS MySQL database instance (uncheck Create final snapshot for lab clean-up).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Networking:&lt;/strong&gt;&lt;br&gt;
 Delete the NAT Gateway and release its Elastic IP, detach and delete the Internet Gateway, and finally delete the VPC (which removes associated subnets, route tables, and custom security groups).&lt;/p&gt;

&lt;p&gt;Would you like a ready-to-use Terraform or AWS CloudFormation template to automate this entire 3-tier deployment, or step-by-step commands for setting up AWS Session Manager to access the private EC2 instances?&lt;/p&gt;

</description>
      <category>cloud</category>
    </item>
  </channel>
</rss>
