<?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: Swarali Chine</title>
    <description>The latest articles on DEV Community by Swarali Chine (@iswarali).</description>
    <link>https://dev.to/iswarali</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%2F3476708%2Fb2d4d15a-1caa-415d-b894-f044c707d0b7.jpeg</url>
      <title>DEV Community: Swarali Chine</title>
      <link>https://dev.to/iswarali</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iswarali"/>
    <language>en</language>
    <item>
      <title>Deploying a Static Website on Amazon EC2 with Apache HTTP Server</title>
      <dc:creator>Swarali Chine</dc:creator>
      <pubDate>Wed, 29 Jul 2026 04:03:57 +0000</pubDate>
      <link>https://dev.to/iswarali/deploying-a-static-website-on-amazon-ec2-with-apache-http-server-48ae</link>
      <guid>https://dev.to/iswarali/deploying-a-static-website-on-amazon-ec2-with-apache-http-server-48ae</guid>
      <description>&lt;p&gt;&lt;u&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Amazon EC2 (Elastic Compute Cloud) is one of the core compute services in AWS, providing scalable virtual servers that can host websites, applications, and enterprise workloads. While AWS offers several managed hosting options, understanding how to manually configure a web server on EC2 provides a strong foundation in Linux administration, networking, and cloud infrastructure.&lt;/p&gt;

&lt;p&gt;In this project, I launched an Amazon EC2 instance running Amazon Linux 2023, installed the Apache HTTP Server, and deployed a custom static website. Along the way, I learned how Security Groups control network access, how Apache serves web content, and how AWS services work together to host a web application.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Why Build This Project?&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Understanding how web applications are hosted on a virtual server is a fundamental cloud engineering skill. Although managed services simplify deployments, manually configuring a web server helps build a deeper understanding of compute, networking, operating systems, and web server administration.&lt;br&gt;
This project demonstrates how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Launch and configure an Amazon EC2 instance&lt;/li&gt;
&lt;li&gt;Secure access using AWS Security Groups&lt;/li&gt;
&lt;li&gt;Install and manage Apache HTTP Server&lt;/li&gt;
&lt;li&gt;Deploy a static HTML website&lt;/li&gt;
&lt;li&gt;Understand how HTTP requests are processed&lt;/li&gt;
&lt;li&gt;Practice responsible AWS resource management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Architecture&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;u&gt;&lt;strong&gt;AWS Services Used in This Project&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;u&gt;&lt;strong&gt;Amazon EC2&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Amazon EC2 (Elastic Compute Cloud) provides resizable virtual servers in the cloud. I used EC2 to host the Apache web server and deploy the static website. It gives complete control over the operating system, networking, storage, and server configuration, making it an excellent service for learning cloud infrastructure.&lt;br&gt;
&lt;u&gt;&lt;strong&gt;Amazon Linux 2023&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Amazon Linux 2023 is an AWS-optimized Linux distribution designed for running applications on Amazon EC2. I selected it because it is lightweight, secure, regularly updated, and integrates seamlessly with AWS services. It also uses the dnf package manager, making software installation and maintenance straightforward.&lt;br&gt;
&lt;u&gt;&lt;strong&gt;Amazon EBS&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Amazon Elastic Block Store (EBS) provides persistent block storage for Amazon EC2 instances. In this project, the root EBS volume stored the operating system, Apache installation, configuration files, and website content. The website files remained available throughout the lifetime of the EC2 instance.&lt;br&gt;
&lt;u&gt;&lt;strong&gt;Security Groups&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Security Groups act as virtual firewalls that control inbound and outbound traffic for EC2 instances. I configured inbound rules to allow SSH access only from my IP address for secure administration and HTTP access on port 80 so users could access the hosted website through a browser.&lt;br&gt;
&lt;u&gt;&lt;strong&gt;Apache HTTP Server&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Apache HTTP Server is one of the world's most widely used open-source web servers. I installed Apache on the EC2 instance to process incoming HTTP requests and serve the custom HTML webpage stored in the server's document root.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 1: Launch an EC2 Instance&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
I launched an EC2 instance using the Amazon Linux 2023 Amazon Machine Image (AMI) and selected a micro instance type suitable for a learning environment.&lt;/p&gt;

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

&lt;p&gt;To securely access the server while making the website publicly available, I configured the following Security Group rules:&lt;br&gt;
SSH (Port 22) → My IP&lt;br&gt;
HTTP (Port 80) → Anywhere (0.0.0.0/0)&lt;/p&gt;

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

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 2: Connect to the Instance&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
I connected to the instance using EC2 Instance Connect and verified the environment before installing Apache.&lt;br&gt;
Some of the first commands I executed were:&lt;br&gt;
whoami&lt;br&gt;
cat /etc/os-release&lt;br&gt;
pwd&lt;br&gt;
These commands confirmed the current user, operating system version, and working directory.&lt;/p&gt;

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

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 3: Install Apache HTTP Server&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
After updating the operating system packages, I installed Apache using the Amazon Linux package manager.&lt;br&gt;
sudo dnf update -y&lt;br&gt;
sudo dnf install httpd -y&lt;br&gt;
Once the installation completed, I started the Apache service and configured it to start automatically whenever the EC2 instance boots.&lt;br&gt;
sudo systemctl start httpd&lt;br&gt;
sudo systemctl enable httpd&lt;br&gt;
I also verified that the service was running successfully.&lt;/p&gt;

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

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 4: Deploy the Website&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Apache serves website files from its default document root:&lt;br&gt;
/var/www/html&lt;br&gt;
I replaced the default Apache welcome page with a custom index.html file and restarted the Apache service.&lt;br&gt;
sudo systemctl restart httpd&lt;br&gt;
After opening the EC2 instance's public IPv4 address in a web browser, my custom website was successfully displayed.&lt;/p&gt;

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

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 5: Verify Apache Configuration&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
To better understand how Apache works, I explored its configuration and log files.&lt;br&gt;
To locate the configured document root:&lt;br&gt;
grep -n "DocumentRoot" /etc/httpd/conf/httpd.conf&lt;br&gt;
To review recent HTTP requests:&lt;br&gt;
sudo tail -10 /var/log/httpd/access_log&lt;br&gt;
These commands helped me understand where Apache stores website content and how incoming requests are recorded for monitoring and troubleshooting.&lt;/p&gt;

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

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Key Takeaways&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
This project provided practical experience with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Launching and managing Amazon EC2 instances&lt;/li&gt;
&lt;li&gt;Understanding Amazon Linux 2023&lt;/li&gt;
&lt;li&gt;Installing and configuring Apache HTTP Server&lt;/li&gt;
&lt;li&gt;Configuring AWS Security Groups&lt;/li&gt;
&lt;li&gt;Managing Linux services using systemctl&lt;/li&gt;
&lt;li&gt;Understanding the Apache document root&lt;/li&gt;
&lt;li&gt;Reading Apache access logs&lt;/li&gt;
&lt;li&gt;Deploying a static website on AWS
More importantly, it strengthened my understanding of how compute, networking, storage, and web server software work together to deliver a web application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Cost Optimization&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
To keep the project cost-effective, I followed several AWS cost optimization practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used a micro EC2 instance suitable for learning&lt;/li&gt;
&lt;li&gt;Used the default root EBS volume&lt;/li&gt;
&lt;li&gt;Avoided provisioning unnecessary AWS resources&lt;/li&gt;
&lt;li&gt;Terminated the EC2 instance immediately after completing the project&lt;/li&gt;
&lt;li&gt;Verified that associated resources were cleaned up to prevent ongoing charges
Managing cloud costs is an important aspect of building production-ready AWS solutions, even for small learning projects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;GitHub Repository&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
The complete project, including source code, documentation, architecture diagrams, and screenshots, is available on GitHub.&lt;br&gt;
Repository:&lt;br&gt;
&lt;a href="https://github.com/swaralichine/aws-projects/tree/main/01-web-hosting-and-deployment/03-ec2-apache-web-server" rel="noopener noreferrer"&gt;https://github.com/swaralichine/aws-projects/tree/main/01-web-hosting-and-deployment/03-ec2-apache-web-server&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Building and deploying a website on Amazon EC2 provided a hands-on introduction to the core building blocks of AWS infrastructure. While the application itself is simple, the project demonstrates several fundamental cloud concepts, including virtual machines, networking, Linux administration, persistent storage, and web server configuration.&lt;/p&gt;

&lt;p&gt;For anyone beginning their AWS learning journey, this project offers an excellent opportunity to understand what happens behind the scenes when hosting a website in the cloud. These foundational skills serve as the basis for more advanced architectures involving load balancing, auto scaling, containers, and highly available applications.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>linux</category>
      <category>networking</category>
    </item>
    <item>
      <title>Deploying a WordPress Blog on AWS Lightsail: A Beginner-Friendly Approach to Hosting Dynamic Websites</title>
      <dc:creator>Swarali Chine</dc:creator>
      <pubDate>Mon, 27 Jul 2026 01:25:26 +0000</pubDate>
      <link>https://dev.to/iswarali/deploying-a-wordpress-blog-on-aws-lightsail-a-beginner-friendly-approach-to-hosting-dynamic-2n53</link>
      <guid>https://dev.to/iswarali/deploying-a-wordpress-blog-on-aws-lightsail-a-beginner-friendly-approach-to-hosting-dynamic-2n53</guid>
      <description>&lt;p&gt;&lt;u&gt;Introduction&lt;/u&gt;&lt;br&gt;
After building my first AWS project—hosting a static website with Amazon S3 and Amazon CloudFront—I wanted to understand what happens when a website needs to generate content dynamically.&lt;/p&gt;

&lt;p&gt;Static websites are great for portfolios and documentation, but applications like WordPress require much more than file storage. They need a server to process requests, an application runtime to execute code, and a database to store content.&lt;/p&gt;

&lt;p&gt;Rather than configuring all of these components manually, I chose Amazon Lightsail, AWS's simplified virtual private server (VPS) service, to understand the fundamentals of hosting a dynamic web application.&lt;/p&gt;

&lt;p&gt;By the end of this project, I had:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deployed a WordPress website&lt;/li&gt;
&lt;li&gt;Logged into the WordPress administration dashboard&lt;/li&gt;
&lt;li&gt;Published my first blog post&lt;/li&gt;
&lt;li&gt;Configured a Static IP&lt;/li&gt;
&lt;li&gt;Created a server snapshot for backup and recovery&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Static vs. Dynamic Websites&lt;/u&gt;&lt;br&gt;
Before starting this project, I wanted to clearly understand why my previous S3 project couldn't host WordPress.&lt;/p&gt;

&lt;p&gt;A static website simply serves files that already exist. Every visitor receives the same HTML, CSS, JavaScript, and images without any server-side processing.&lt;/p&gt;

&lt;p&gt;A dynamic website is different. Every request is processed by the server, which executes application logic, retrieves information from a database, and generates the webpage before sending it to the user's browser.&lt;/p&gt;

&lt;p&gt;WordPress is one of the most common examples of a dynamic web application because every page depends on PHP and a database.&lt;/p&gt;

&lt;p&gt;Diagram 1 – Static vs. Dynamic Website&lt;br&gt;
               Static Website&lt;/p&gt;

&lt;p&gt;Browser&lt;br&gt;
    │&lt;br&gt;
    ▼&lt;br&gt;
 Amazon S3&lt;br&gt;
    │&lt;br&gt;
    ▼&lt;br&gt;
HTML • CSS • JavaScript&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;           Dynamic Website
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Browser&lt;br&gt;
    │&lt;br&gt;
    ▼&lt;br&gt;
Apache Web Server&lt;br&gt;
    │&lt;br&gt;
    ▼&lt;br&gt;
PHP Runtime&lt;br&gt;
    │&lt;br&gt;
    ▼&lt;br&gt;
MariaDB Database&lt;br&gt;
    │&lt;br&gt;
    ▼&lt;br&gt;
Generated HTML&lt;/p&gt;

&lt;p&gt;Because WordPress relies on server-side processing, it cannot simply be hosted in an S3 bucket.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Why Amazon Lightsail?&lt;/u&gt;&lt;br&gt;
AWS offers several compute services, including Amazon EC2 and Amazon Lightsail.&lt;/p&gt;

&lt;p&gt;For beginners and small projects, Lightsail removes much of the operational complexity while still exposing the key concepts behind cloud infrastructure.&lt;/p&gt;

&lt;p&gt;With a few clicks, Lightsail provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A virtual Linux server&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;Storage&lt;/li&gt;
&lt;li&gt;Static IP support&lt;/li&gt;
&lt;li&gt;Built-in application blueprints&lt;/li&gt;
&lt;li&gt;Predictable monthly pricing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of installing Ubuntu, Apache, PHP, MariaDB, and WordPress individually, I selected the WordPress blueprint and AWS provisioned everything automatically.&lt;/p&gt;

&lt;p&gt;This allowed me to focus on understanding the architecture rather than spending time configuring the operating system.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Solution Architecture&lt;/u&gt;&lt;br&gt;
The deployed architecture is straightforward but introduces several important AWS concepts.&lt;/p&gt;

&lt;p&gt;Diagram 2 – Architecture&lt;br&gt;
                 Internet&lt;br&gt;
                      │&lt;br&gt;
                      ▼&lt;br&gt;
               Static Public IP&lt;br&gt;
                      │&lt;br&gt;
                      ▼&lt;br&gt;
         Amazon Lightsail Instance&lt;br&gt;
      ┌─────────────────────────────┐&lt;br&gt;
      │ Ubuntu Linux                │&lt;br&gt;
      │ Apache Web Server           │&lt;br&gt;
      │ PHP Runtime                 │&lt;br&gt;
      │ MariaDB Database            │&lt;br&gt;
      │ WordPress Application       │&lt;br&gt;
      └─────────────────────────────┘&lt;br&gt;
                      │&lt;br&gt;
                      ▼&lt;br&gt;
              Lightsail Snapshot&lt;/p&gt;

&lt;p&gt;Each component plays an important role.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ubuntu hosts the application.&lt;/li&gt;
&lt;li&gt;Apache receives incoming HTTP requests.&lt;/li&gt;
&lt;li&gt;PHP executes the WordPress application.&lt;/li&gt;
&lt;li&gt;MariaDB stores posts, pages, users, and settings.&lt;/li&gt;
&lt;li&gt;Static IP provides a consistent public endpoint.&lt;/li&gt;
&lt;li&gt;Snapshot enables backup and disaster recovery.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Deployment Walkthrough&lt;/u&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Launching the WordPress Instance
Using the WordPress blueprint, AWS automatically created a fully configured environment with Ubuntu, Apache, PHP, MariaDB, and WordPress.
This eliminated the need to manually install and configure each component.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ol&gt;
&lt;li&gt;Accessing the WordPress Dashboard
After retrieving the administrator password from the instance, I logged into the WordPress admin dashboard.
From there, I could manage the website, configure settings, install plugins, and publish content.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ol&gt;
&lt;li&gt;Publishing My First Blog Post
To verify that everything was working correctly, I created and published my first blog post.
This confirmed that the web server, PHP runtime, and database were communicating correctly.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ol&gt;
&lt;li&gt;Configuring a Static IP
Initially, the instance was assigned a temporary public IP address.
Since public IP addresses can change if an instance is recreated or restarted, I attached a Static IP.
Using a permanent IP address makes it easier to associate the server with a domain name in the future.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ol&gt;
&lt;li&gt;Creating a Snapshot
Before deleting the environment, I created a Lightsail snapshot.
Snapshots capture the complete state of the server, including:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Operating system&lt;/li&gt;
&lt;li&gt;WordPress installation&lt;/li&gt;
&lt;li&gt;Configuration&lt;/li&gt;
&lt;li&gt;Database&lt;/li&gt;
&lt;li&gt;Uploaded content
This makes it possible to restore the environment if needed.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;u&gt;How a Request Reaches WordPress&lt;/u&gt;&lt;br&gt;
Understanding the request flow helped me connect the different components of the architecture.&lt;br&gt;
Diagram 3 – Request Flow&lt;br&gt;
Browser&lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
Static IP&lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
Apache&lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
PHP&lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
WordPress&lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
MariaDB&lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
HTML Response&lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
Browser&lt;/p&gt;

&lt;p&gt;Every page request follows this sequence before the generated HTML is returned to the user.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Cost Optimization&lt;/u&gt;&lt;br&gt;
One of my goals was to complete this project while keeping costs as low as possible.&lt;br&gt;
To achieve this, I:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Selected the smallest available Lightsail instance&lt;/li&gt;
&lt;li&gt;Did not purchase a custom domain&lt;/li&gt;
&lt;li&gt;Deferred HTTPS configuration because it typically requires a registered domain&lt;/li&gt;
&lt;li&gt;Deleted the instance, Static IP, and snapshot immediately after completing the project
Since the environment was only active during development and testing, the actual cost was only a small fraction of the monthly Lightsail plan.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Key Takeaways&lt;/u&gt;&lt;br&gt;
This project helped reinforce several cloud concepts that are useful beyond WordPress hosting.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic applications require compute resources.&lt;/li&gt;
&lt;li&gt;A web server processes incoming requests before generating a response.&lt;/li&gt;
&lt;li&gt;Databases are essential for storing application data.&lt;/li&gt;
&lt;li&gt;Static IPs provide stable network endpoints.&lt;/li&gt;
&lt;li&gt;Snapshots are a simple but effective disaster recovery mechanism.&lt;/li&gt;
&lt;li&gt;Managed services like Amazon Lightsail simplify infrastructure while still teaching the core principles of cloud computing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Conclusion&lt;/u&gt;&lt;br&gt;
Amazon Lightsail provides an excellent balance between simplicity and functionality, making it an ideal service for learning how dynamic web applications are deployed in AWS.&lt;/p&gt;

&lt;p&gt;While the deployment process is straightforward, the project introduces several foundational cloud concepts—including compute, networking, storage, application hosting, and backup strategies—that are applicable across many AWS services.&lt;/p&gt;

&lt;p&gt;For anyone beginning their cloud journey or looking for a simple way to host a WordPress application, Amazon Lightsail offers an approachable starting point without requiring extensive infrastructure management.&lt;/p&gt;

&lt;p&gt;GitHub Repository&lt;br&gt;
You can find the complete project, documentation, architecture, and screenshots here:&lt;br&gt;
&lt;a href="https://github.com/swaralichine/aws-projects/tree/main/01-web-hosting-and-deployment/02-wordpress-aws-lightsail" rel="noopener noreferrer"&gt;https://github.com/swaralichine/aws-projects/tree/main/01-web-hosting-and-deployment/02-wordpress-aws-lightsail&lt;/a&gt;&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>lightsail</category>
      <category>staticwebapps</category>
      <category>aws</category>
    </item>
    <item>
      <title>Building a Secure Static Website on AWS with Amazon S3 and CloudFront.</title>
      <dc:creator>Swarali Chine</dc:creator>
      <pubDate>Sun, 26 Jul 2026 16:54:51 +0000</pubDate>
      <link>https://dev.to/iswarali/building-a-secure-static-website-on-aws-with-amazon-s3-and-cloudfront-1d96</link>
      <guid>https://dev.to/iswarali/building-a-secure-static-website-on-aws-with-amazon-s3-and-cloudfront-1d96</guid>
      <description>&lt;p&gt;&lt;u&gt;Introduction&lt;/u&gt;&lt;br&gt;
Hosting a static website is one of the simplest ways to deploy content on the web. Whether it's a personal portfolio, documentation site, product landing page, or blog, static websites consist of files such as HTML, CSS, JavaScript, and images that don't require a backend server or database.&lt;br&gt;
While Amazon S3 makes it easy to host static content, simply enabling S3 Static Website Hosting requires making the bucket publicly accessible. Although suitable for demonstrations, exposing the storage layer directly isn't the most secure approach.&lt;br&gt;
A more robust architecture is to keep the Amazon S3 bucket private and use Amazon CloudFront as the public entry point. CloudFront securely retrieves content from the bucket using Origin Access Control (OAC), delivers it over HTTPS, caches content closer to users, and improves both security and performance.&lt;br&gt;
In this article, we'll build a secure static website using Amazon S3 and Amazon CloudFront while following AWS best practices.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Prerequisites&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Before getting started, you'll need:&lt;/li&gt;
&lt;li&gt;An active AWS account&lt;/li&gt;
&lt;li&gt;Basic familiarity with the AWS Management Console&lt;/li&gt;
&lt;li&gt;A static website (HTML, CSS, JavaScript, and supporting assets)&lt;/li&gt;
&lt;li&gt;Basic understanding of Amazon S3&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;What You'll Build&lt;/u&gt;&lt;br&gt;
By the end of this project, you'll have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A private Amazon S3 bucket storing your website files&lt;/li&gt;
&lt;li&gt;An Amazon CloudFront distribution serving the website globally&lt;/li&gt;
&lt;li&gt;Origin Access Control (OAC) securing access between CloudFront and Amazon S3&lt;/li&gt;
&lt;li&gt;HTTPS-enabled website delivery&lt;/li&gt;
&lt;li&gt;A scalable, low-maintenance static website architecture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Architecture&lt;/u&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;u&gt;Why These AWS Services?&lt;/u&gt;&lt;br&gt;
&lt;u&gt;Amazon S3&lt;/u&gt;&lt;br&gt;
Amazon S3 is AWS's object storage service designed to provide highly durable, available, and scalable storage. Since static websites are simply collections of files, S3 provides an ideal location to store website assets without managing web servers or application infrastructure.&lt;br&gt;
For this project, Amazon S3 acts as the origin that stores the website files.&lt;br&gt;
&lt;u&gt;Amazon CloudFront&lt;/u&gt;&lt;br&gt;
Although Amazon S3 stores the website content, it isn't optimized to deliver that content efficiently to users across different geographic locations.&lt;br&gt;
Amazon CloudFront is AWS's Content Delivery Network (CDN). Instead of every request reaching the origin bucket, CloudFront caches content at AWS edge locations around the world, allowing users to retrieve content from the nearest location.&lt;br&gt;
Using CloudFront provides several benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lower latency&lt;/li&gt;
&lt;li&gt;Faster page load times&lt;/li&gt;
&lt;li&gt;HTTPS support&lt;/li&gt;
&lt;li&gt;Reduced requests to the origin&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Improved scalability during traffic spikes&lt;br&gt;
&lt;u&gt;Origin Access Control (OAC)&lt;/u&gt;&lt;br&gt;
One of the most important design decisions in this architecture is preventing direct public access to the Amazon S3 bucket.&lt;br&gt;
Origin Access Control allows CloudFront to securely access objects stored in Amazon S3 while ensuring that users cannot access the bucket directly.&lt;br&gt;
This approach provides:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A private Amazon S3 bucket&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Controlled access through CloudFront&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reduced attack surface&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Better alignment with AWS security best practices&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Implementation&lt;/u&gt;&lt;br&gt;
The solution was implemented in four simple steps.&lt;br&gt;
Step 1 – Create an Amazon S3 Bucket&lt;br&gt;
A new Amazon S3 bucket was created to store the website files.&lt;br&gt;
To improve security, Block Public Access remained enabled so that objects could not be accessed directly from the internet.&lt;br&gt;
The following website assets were uploaded:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;index.html&lt;/li&gt;
&lt;li&gt;styles.css&lt;/li&gt;
&lt;li&gt;script.js&lt;/li&gt;
&lt;li&gt;error.html&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvg0vlx34n9sznqcm484x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvg0vlx34n9sznqcm484x.png" alt=" " width="800" height="395"&gt;&lt;/a&gt;&lt;br&gt;
Step 2 – Configure Amazon CloudFront&lt;br&gt;
An Amazon CloudFront distribution was created using the Amazon S3 bucket as the origin.&lt;br&gt;
The following configuration was applied:&lt;br&gt;
Origin Access Control (OAC) enabled&lt;br&gt;
Default root object configured as index.html&lt;br&gt;
HTTPS enabled&lt;br&gt;
Default CloudFront domain used for testing&lt;br&gt;
CloudFront automatically updated the bucket policy, allowing secure access to the private S3 bucket.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnvejx8xox96n7naks18k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnvejx8xox96n7naks18k.png" alt=" " width="799" height="143"&gt;&lt;/a&gt;&lt;br&gt;
Step 3 – Deploy the Website&lt;br&gt;
After the CloudFront distribution finished deploying, the generated CloudFront domain successfully served the website over HTTPS.&lt;br&gt;
CloudFront caches content at edge locations, allowing future requests to be served faster while reducing requests to the origin bucket.&lt;/p&gt;

&lt;p&gt;Security Considerations&lt;br&gt;
The following AWS best practices were implemented:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon S3 Block Public Access enabled&lt;/li&gt;
&lt;li&gt;Private Amazon S3 bucket&lt;/li&gt;
&lt;li&gt;Origin Access Control (OAC) configured&lt;/li&gt;
&lt;li&gt;CloudFront acting as the only public entry point&lt;/li&gt;
&lt;li&gt;HTTPS used for all client communication
Keeping the storage layer private while exposing only CloudFront significantly improves the security posture of the application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cost Estimate&lt;br&gt;
The architecture is inexpensive to operate and is well suited for personal portfolios, documentation websites, and small business websites.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon S3 – Stores the static website files (HTML, CSS, JavaScript, images, and other assets). Estimated cost: Less than $0.50/month for a small personal website.&lt;/li&gt;
&lt;li&gt;Amazon CloudFront – Delivers website content globally with low latency through edge locations and HTTPS support. Estimated cost: Approximately $0–$2/month for light traffic.&lt;/li&gt;
&lt;li&gt;Origin Access Control (OAC) – Securely allows CloudFront to access the private Amazon S3 bucket while preventing direct public access. Estimated cost: No additional cost.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Estimated monthly cost: $0–$2 for a personal portfolio or low-traffic website.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Challenges and Lessons Learned&lt;/u&gt;&lt;br&gt;
One of the biggest lessons from this project was understanding the difference between Amazon S3 Static Website Hosting and serving content through Amazon CloudFront.&lt;br&gt;
While enabling static website hosting on Amazon S3 is straightforward, using CloudFront with Origin Access Control provides a more secure architecture by keeping the storage bucket private and allowing access only through CloudFront.&lt;br&gt;
Another key takeaway was learning how CloudFront deployments work. Configuration changes require time to propagate across AWS edge locations, so it's important to wait for the distribution to finish deploying before validating the website.&lt;br&gt;
Finally, this project demonstrated how combining multiple AWS managed services results in a solution that is secure, scalable, and easy to maintain without managing any servers.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Key Takeaways&lt;/u&gt;&lt;br&gt;
This project demonstrates how AWS managed services can be combined to build a secure and scalable static website.&lt;br&gt;
By completing this implementation, we achieved:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Secure object storage using Amazon S3&lt;/li&gt;
&lt;li&gt;Global content delivery with Amazon CloudFront&lt;/li&gt;
&lt;li&gt;Private origin access using Origin Access Control (OAC)&lt;/li&gt;
&lt;li&gt;HTTPS-enabled website delivery&lt;/li&gt;
&lt;li&gt;Improved performance through edge caching&lt;/li&gt;
&lt;li&gt;A low-cost, highly scalable hosting solution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Resources&lt;/u&gt;&lt;br&gt;
GitHub Repository&lt;br&gt;
Project Repository&lt;br&gt;
&lt;a href="https://github.com/swaralichine/aws-projects/tree/main/01-web-hosting-and-deployment/01-static-website-s3-cloudfront" rel="noopener noreferrer"&gt;https://github.com/swaralichine/aws-projects/tree/main/01-web-hosting-and-deployment/01-static-website-s3-cloudfront&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;AWS Documentation&lt;br&gt;
Amazon S3 User Guide-&lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html&lt;/a&gt; &lt;br&gt;
Amazon CloudFront Developer Guide-&lt;br&gt;
&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html&lt;/a&gt; &lt;br&gt;
Restrict access to an Amazon S3 origin using Origin Access Control (OAC)-&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html&lt;/a&gt; &lt;/p&gt;

</description>
      <category>aws</category>
      <category>awss3</category>
      <category>cloudfront</category>
      <category>staticwebsite</category>
    </item>
  </channel>
</rss>
