<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Raj Ahire on Medium]]></title>
        <description><![CDATA[Stories by Raj Ahire on Medium]]></description>
        <link>https://medium.com/@rajahire326?source=rss-e832a56c2bd8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jGG19JHQM2o-c5thRUMtnA.jpeg</url>
            <title>Stories by Raj Ahire on Medium</title>
            <link>https://medium.com/@rajahire326?source=rss-e832a56c2bd8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 11:28:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajahire326/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Multi-Account AWS Setup using AWS Organizations & Organizational Units]]></title>
            <link>https://medium.com/@rajahire326/building-a-multi-account-aws-setup-using-aws-organizations-organizational-units-e975a2ac81fe?source=rss-e832a56c2bd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/e975a2ac81fe</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloud-security]]></category>
            <dc:creator><![CDATA[Raj Ahire]]></dc:creator>
            <pubDate>Thu, 05 Mar 2026 10:43:50 GMT</pubDate>
            <atom:updated>2026-03-05T10:43:50.572Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Recently, I explored <strong>AWS Organizations and Organizational Units (OUs)</strong> and implemented a project to understand how enterprises manage multiple AWS accounts securely.</p><p>In large organizations, different teams such as <strong>Development, Testing, and Production</strong> require separate environments. Managing everything in a single AWS account can lead to security risks and poor governance. AWS solves this problem using <strong>multi-account architecture with AWS Organizations</strong>.</p><p>In this project, I built a <strong>multi-account setup with three environments: Dev, Test, and Prod</strong>, and implemented governance using <strong>Service Control Policies (SCPs)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OflKmEi5wTzhezP5yynMAw.png" /></figure><h3>Project Goal</h3><p>The goal of this project was to:</p><ul><li>Understand how <strong>AWS Organizations</strong> works</li><li>Create <strong>multiple AWS accounts for different environments</strong></li><li>Use <strong>Organizational Units (OUs)</strong> to group accounts</li><li>Implement <strong>Service Control Policies (SCPs)</strong> for centralized governance</li></ul><h3>Step 1: Creating an AWS Organization</h3><p>The first step was to create an <strong>AWS Organization</strong>.</p><p>After creating the organization, AWS automatically creates a <strong>Root account</strong> with <strong>all features enabled</strong>, which allows the use of <strong>Service Control Policies (SCPs)</strong> and advanced governance features.</p><p>This root account acts as the <strong>central management account</strong> for all other AWS accounts.</p><h3>Step 2: Creating Organizational Units (OUs)</h3><p>Next, I created <strong>three Organizational Units</strong> to logically separate environments:</p><ul><li><strong>Dev OU</strong> — for development work</li><li><strong>Test OU</strong> — for testing and validation</li><li><strong>Prod OU</strong> — for production workloads</li></ul><p>Organizational Units help structure accounts in a hierarchy and make policy management easier.</p><h3>Step 3: Creating Multiple AWS Accounts</h3><p>AWS Organizations provides an option to <strong>create or invite accounts</strong> directly.</p><p>For this project, I created three different accounts:</p><ul><li><strong>Dev Account</strong></li><li><strong>Test Account</strong></li><li><strong>Prod Account</strong></li></ul><p>These accounts were then placed inside their respective <strong>Organizational Units</strong>.</p><p>This structure simulates how enterprises separate environments to improve <strong>security, isolation, and governance</strong>.</p><h3>Step 4: Creating Service Control Policies (SCPs)</h3><p>Next, I created <strong>three Service Control Policies (SCPs)</strong> to enforce governance rules.</p><h3>1. Deny Large EC2 Instances in Dev</h3><p>Developers should not launch expensive instances in the development environment.</p><p>This policy <strong>denies launching large EC2 instances (like m5.large)</strong> in the Dev account.</p><h3>2. Prevent CloudTrail Deletion</h3><p>CloudTrail is critical for <strong>logging and auditing AWS activity</strong>.</p><p>This policy ensures that <strong>no team can disable or delete CloudTrail</strong>, protecting audit logs.</p><h3>3. Restrict AWS Regions</h3><p>Organizations often restrict workloads to specific regions for <strong>compliance and cost control</strong>.</p><p>This policy restricts usage to <strong>approved AWS regions only</strong>.</p><h3>Step 5: Attaching Policies to Organizational Units</h3><p>After creating the policies, I attached them to the appropriate Organizational Units:</p><ul><li><strong>Dev OU → Deny Large EC2 Instances</strong></li><li><strong>Root OU → Prevent CloudTrail Deletion</strong></li><li><strong>All Accounts → Region Restriction Policy</strong></li></ul><p>This ensures centralized governance across accounts.</p><h3>Step 6: Validating the Policies</h3><p>To verify that the policies were working correctly, I <strong>switched roles into the Dev account</strong> and attempted to launch a large EC2 instance.</p><p>The launch <strong>failed due to the Service Control Policy</strong>, confirming that the governance rule was successfully enforced.</p><p>Similarly, other restrictions were validated across the accounts.</p><h3>Key Learnings</h3><p>Through this project, I learned how enterprises implement <strong>multi-account architecture</strong> in AWS.</p><p>Key takeaways include:</p><ul><li>AWS Organizations enables <strong>centralized governance</strong></li><li>Organizational Units help <strong>structure accounts logically</strong></li><li>Service Control Policies enforce <strong>security and compliance rules</strong></li><li>Multi-account architecture improves <strong>security, isolation, and cost management</strong></li></ul><h3>Conclusion</h3><p>This project helped me understand how organizations manage <strong>large-scale AWS environments</strong> using a <strong>multi-account architecture</strong>.</p><p>The most important concept is the <strong>Principle of Least Privilege</strong>, where users and teams are given only the permissions they actually need. This reduces security risks and prevents misuse of cloud resources.</p><p>Using <strong>AWS Organizations, Organizational Units, and Service Control Policies</strong>, companies can implement strong governance across multiple AWS accounts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e975a2ac81fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Getting Started with Grafana: Visualizing Metrics Like a DevOps Engineer]]></title>
            <link>https://medium.com/@rajahire326/getting-started-with-grafana-visualizing-metrics-like-a-devops-engineer-d659ee17182e?source=rss-e832a56c2bd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d659ee17182e</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[grafana]]></category>
            <dc:creator><![CDATA[Raj Ahire]]></dc:creator>
            <pubDate>Fri, 20 Feb 2026 20:29:17 GMT</pubDate>
            <atom:updated>2026-02-20T20:29:17.884Z</atom:updated>
            <content:encoded><![CDATA[<p>When I first started monitoring servers using Prometheus, I could see raw metrics — CPU usage, memory consumption, network stats.</p><p>But something was missing.</p><p>Numbers alone don’t tell the full story.</p><p>That’s when I started using <strong>Grafana</strong> — and honestly, that’s when monitoring started making real sense.</p><p>In this blog, I’ll explain Grafana in simple terms and how it helps DevOps engineers build powerful monitoring dashboards.</p><h3>📌 What is Grafana?</h3><p>Grafana is an open-source data visualization and monitoring tool that allows you to create interactive dashboards using data from different sources.</p><p>It doesn’t collect metrics by itself.</p><p>Instead, it connects to data sources like:</p><ul><li>Prometheus</li><li>MySQL</li><li>PostgreSQL</li><li>Elasticsearch</li><li>CloudWatch</li><li>InfluxDB</li></ul><p>In simple words:</p><blockquote><em>Grafana takes monitoring data and turns it into beautiful, meaningful dashboards.</em></blockquote><h3>🚀 Why Grafana is Important in DevOps</h3><p>From my practical experience, here’s why Grafana is powerful:</p><h3>1️⃣ Real-Time Visualization</h3><p>Instead of reading raw numbers, you see:</p><ul><li>Line graphs</li><li>Bar charts</li><li>Gauge meters</li><li>Heatmaps</li><li>Alerts</li></ul><p>This helps quickly understand system health.</p><h3>2️⃣ Works Perfectly with Prometheus</h3><p>When I connected Grafana to Prometheus running on my EC2 server, I could instantly:</p><ul><li>Monitor CPU usage</li><li>Track memory consumption</li><li>Watch disk I/O</li><li>Observe request spikes</li></ul><p>It made debugging much easier.</p><h3>3️⃣ Alerting System</h3><p>Grafana allows you to configure alerts.</p><p>Example:</p><ul><li>If CPU &gt; 80%</li><li>If memory usage &gt; 90%</li><li>If server is down</li></ul><p>It can send notifications via:</p><ul><li>Email</li><li>Slack</li><li>Webhooks</li></ul><h3>🏗️ Grafana Architecture Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V5kA3mBUr8tZEOqwJpNY_A.png" /></figure><p>Basic flow</p><ol><li>Application / Server generates metrics</li><li>Prometheus collects and stores metrics</li><li>Grafana connects to Prometheus</li><li>Dashboards visualize metrics</li><li>Alerts notify issues</li></ol><p>Simple but extremely powerful setup.</p><h3>⚙️ How I Set Up Grafana (Basic Steps)</h3><p>Here’s how I implemented it in my DevOps lab:</p><ol><li>Installed Grafana on Linux server</li><li>Started Grafana service</li><li>Accessed it on port 3000</li><li>Logged in using default admin credentials</li><li>Added Prometheus as data source</li><li>Imported pre-built Node Exporter dashboard</li></ol><p>Within minutes, I had a production-like monitoring system running.</p><h3>📊 What Makes Grafana Special?</h3><p>Here are features I personally found impressive</p><ul><li>🔥 Pre-built dashboards (just import JSON)</li><li>📈 Highly customizable panels</li><li>🌐 Multi-data source support</li><li>🎨 Clean and professional UI</li><li>📡 Cloud + On-Premise monitoring</li><li>🔐 Role-based access control</li></ul><h3>💡 Real-World Use Cases</h3><p>Grafana is widely used for:</p><ul><li>Kubernetes monitoring</li><li>AWS infrastructure monitoring</li><li>Docker container metrics</li><li>Application performance monitoring</li><li>Database monitoring</li><li>Microservices observability</li></ul><p>If you’re preparing for DevOps interviews, Grafana + Prometheus combo is almost always discussed.</p><h3>🎯 Why Every DevOps Engineer Should Learn Grafana</h3><p>From my learning journey, I realized:</p><p>Monitoring is not just about collecting data.<br> It’s about understanding data.</p><p>Grafana helps you:</p><ul><li>Detect system bottlenecks</li><li>Analyze performance trends</li><li>Prevent downtime</li><li>Improve reliability</li></ul><p>And that’s exactly what companies look for in DevOps engineers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d659ee17182e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Getting Started with Prometheus: A Beginner-Friendly Guide to Modern Monitoring]]></title>
            <link>https://medium.com/@rajahire326/getting-started-with-prometheus-a-beginner-friendly-guide-to-modern-monitoring-ba9311367314?source=rss-e832a56c2bd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba9311367314</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[virtual-reality]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Raj Ahire]]></dc:creator>
            <pubDate>Thu, 19 Feb 2026 17:06:24 GMT</pubDate>
            <atom:updated>2026-02-19T17:06:24.242Z</atom:updated>
            <content:encoded><![CDATA[<p>When I first started learning DevOps and cloud monitoring, I kept hearing one name again and again — <strong>Prometheus</strong>.</p><p>At first, I thought it was just another monitoring tool. But once I implemented it in my own project, I realized why it’s one of the most powerful open-source monitoring systems used in modern cloud-native environments.</p><p>In this blog, I’ll explain Prometheus in simple terms — what it is, why it matters, and how it works in real-world DevOps setups.</p><h3>📌 What is Prometheus?</h3><p>Prometheus is an open-source monitoring and alerting toolkit originally built at SoundCloud. Today, it’s a graduated project under the Cloud Native Computing Foundation.</p><p>In simple words:</p><blockquote><em>Prometheus collects metrics (numbers like CPU usage, memory usage, requests per second), stores them, and helps you monitor your systems in real-time.</em></blockquote><p>It works perfectly with:</p><ul><li>Cloud environments</li><li>Kubernetes</li><li>Microservices</li><li>EC2 servers</li><li>Containers</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PAkjyTcfff7T4HAJcXX-wA.png" /></figure><h3>🔥 Why Prometheus is So Popular in DevOps</h3><p>Here’s why companies and DevOps engineers prefer Prometheus:</p><h3>1️⃣ Pull-Based Monitoring</h3><p>Prometheus “pulls” metrics from targets instead of waiting for them to push data.</p><p>This makes it:</p><ul><li>More reliable</li><li>Easier to control</li><li>Secure and scalable</li></ul><h3>2️⃣ Time-Series Database</h3><p>Prometheus stores data as time-series.</p><p>Example:</p><pre>CPU_Usage{instance=&quot;server1&quot;} 45% at 10:01<br>CPU_Usage{instance=&quot;server1&quot;} 52% at 10:00</pre><p>This helps track performance trends over time.</p><h3>3️⃣ Powerful Query Language (PromQL)</h3><p>Prometheus comes with its own query language called PromQL.</p><p>With PromQL, you can:</p><ul><li>Calculate averages</li><li>Detect spikes</li><li>Create alerts</li><li>Analyze performance trends</li></ul><h3>🏗️ How Prometheus Architecture Works</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QgfIqssNISYQxRPg.png" /></figure><p>The architecture is simple but powerful:</p><ol><li><strong>Targets</strong> → Applications or servers exposing metrics</li><li><strong>Exporters</strong> → Tools that convert system data into Prometheus-readable format</li><li><strong>Prometheus Server</strong> → Scrapes and stores metrics</li><li><strong>Alertmanager</strong> → Sends alerts</li><li><strong>Grafana (optional)</strong> → Visualization dashboard</li></ol><h3>📊 What is Node Exporter?</h3><p>Node Exporter is commonly used to monitor Linux servers.</p><p>It exposes:</p><ul><li>CPU usage</li><li>Memory usage</li><li>Disk space</li><li>Network statistics</li></ul><p>If you’re running an AWS EC2 instance like I did, installing Node Exporter is one of the first steps to monitor system-level metrics.</p><h3>⚙️ How Prometheus Works (Step-by-Step)</h3><p>Here’s what happens in a real setup:</p><ol><li>You install Node Exporter on your server.</li><li>Prometheus server is configured with target IP + port.</li><li>Prometheus scrapes metrics every few seconds.</li><li>Data gets stored in Prometheus time-series database.</li><li>You visualize metrics using Grafana dashboards.</li><li>Alerts are triggered if thresholds are crossed.</li></ol><p>Simple. Clean. Powerful.</p><h3>💡 Real-World Use Cases</h3><p>Prometheus is widely used for:</p><ul><li>Kubernetes monitoring</li><li>AWS EC2 monitoring</li><li>Docker container monitoring</li><li>Application performance monitoring</li><li>Microservices observability</li></ul><p>If you’re preparing for DevOps interviews, Prometheus is almost always asked in monitoring-related questions.</p><h3>📈 Why Every DevOps Engineer Should Learn Prometheus</h3><p>From my learning experience, here’s what I realized:</p><p>If you want to become a strong DevOps engineer, monitoring is not optional.</p><p>You must understand:</p><ul><li>System health</li><li>Alerting strategies</li><li>Performance bottlenecks</li><li>Infrastructure visibility</li></ul><p>Prometheus gives you that foundation.</p><h3>🎯 Final Thoughts</h3><p>When I first set up Prometheus with Node Exporter on AWS EC2, it completely changed how I looked at monitoring.</p><p>Instead of guessing what’s happening inside the server, I could <strong>see real-time data</strong>.</p><p>If you’re learning DevOps, I strongly recommend implementing Prometheus practically — not just theoretically.</p><p>That’s where real understanding begins.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba9311367314" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[First Meetup: AI & SaaS Startups ]]></title>
            <link>https://medium.com/@rajahire326/first-meetup-ai-saas-startups-6774e6d5069e?source=rss-e832a56c2bd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/6774e6d5069e</guid>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[growth]]></category>
            <dc:creator><![CDATA[Raj Ahire]]></dc:creator>
            <pubDate>Sun, 15 Feb 2026 18:43:08 GMT</pubDate>
            <atom:updated>2026-02-15T18:43:08.286Z</atom:updated>
            <content:encoded><![CDATA[<p>My name is Raj.</p><p>A few days back, I installed an application called <strong>Meetup</strong>. It is a platform for people who want to explore more about their field, make new connections, build communities, get help for startups, and pitch themselves to other professionals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*0HubbFag3duwxTEhAiS39g.png" /></figure><p>I was not aware of how it actually works. I was just going through the app when I saw a meetup for <strong>AI and SaaS startups</strong>. I thought — maybe this is where I can go and experience how things really work.</p><p>So I booked my slot on their official website. The meetup was held on <strong>15th February 2026 (Sunday)</strong>. I had nothing to do that day, and the place was one hour away from our room.</p><p>Me and my friend Mahesh went together.<br> We were a bit nervous… but excited.</p><p>When we reached the building parking area, we saw a bunch of older people and small children. For a second, we both got confused. Then I checked the address again — it was on the 5th floor.</p><p>We were a bit early. When we reached the office area, it was actually a great workspace setup. Slowly, people started coming in. Around 50 people gathered — all full of passion. Everyone had a purpose. Everyone had their own pitches and doubts.</p><p>The meetup started with introductions.<br> When my turn came, I was confused for a second — but I introduced myself. Others did the same.</p><p>There were mainly three invited speakers:</p><ul><li><strong>Anmol</strong> — running a startup serving US clients.</li><li>One founder with an IITian background who collaborated with IDFC.</li><li>Abhisek — who worked with multiple colleges for admissions and related services.</li></ul><p>They had great fluency in English. But more than that, I loved their attitude.</p><p>Everyone got a chance to ask questions, raise problems, and discuss solutions.</p><p>It was a two-hour session, but honestly, it felt like only 30 minutes. I was fully focused — observing how they talk, how they listen, their posture, their confidence.</p><p>I got the chance to listen to their journeys — their struggles, how they got their first client, how they scaled, how they reached their first million.</p><p>At the end, there was a networking session.</p><p>That was the hardest part for me.</p><p>I was scared.<br> I was shy.<br> I didn’t know what to ask.<br> I didn’t know how to start a conversation.</p><p>But still — I was there.</p><p>And that itself was a win for me.</p><h3>Few thoughts that stayed with me:</h3><ul><li>Choose a real problem, then find the answer.</li><li>Always ask “Why?” Why this? Why now? Why me?</li><li>Your motto will change — but you and your product must evolve.</li></ul><p>This was my first AI &amp; SaaS startup meetup experience.</p><p>And this is just the beginning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6774e6d5069e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Docker on AWS EC2: Running Nginx in a Container]]></title>
            <link>https://medium.com/@rajahire326/getting-started-with-docker-on-aws-ec2-running-nginx-in-a-container-7d25d2888a89?source=rss-e832a56c2bd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d25d2888a89</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Raj Ahire]]></dc:creator>
            <pubDate>Fri, 26 Dec 2025 10:51:47 GMT</pubDate>
            <atom:updated>2025-12-26T10:51:47.892Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A hands-on beginner project to understand Docker installation, containers, and port mapping on Amazon Linux</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z8kZQj7Rpjbk4hfaAZcxGQ.png" /></figure><p>When I started learning Docker, I realized that most tutorials focus heavily on commands but don’t clearly show how Docker works in a <strong>real cloud environment</strong>.<br>So I decided to start with a very simple, practical project — <strong>install Docker on an AWS EC2 instance and run Nginx inside a container</strong>.</p><p>This blog is not about theory or definitions.<br>It’s about <strong>doing things step by step and understanding what actually happens</strong>.</p><h3>Why I Chose This Project</h3><p>Before moving to advanced topics like Dockerfiles or Kubernetes, I wanted answers to some basic but important questions:</p><ul><li>How does Docker work on an AWS EC2 instance?</li><li>How does a container expose an application to the internet?</li><li>What does port mapping really mean?</li><li>Why use Docker instead of installing software directly on the server?</li></ul><p>This small project helped me understand all of this clearly.</p><h3>Project Overview</h3><p>In this project, I performed the following steps:</p><ul><li>Launched an AWS EC2 instance</li><li>Installed Docker on Amazon Linux 2023</li><li>Started and enabled the Docker service</li><li>Pulled the official Nginx image from Docker Hub</li><li>Ran an Nginx container</li><li>Mapped container port <strong>80</strong> to host port <strong>80</strong></li><li>Verified the application using a web browser</li></ul><p>The goal was simple:<br>👉 <strong>Access Nginx running inside a Docker container using the EC2 public IP</strong></p><h3>Technology Stack Used</h3><ul><li>AWS EC2</li><li>Amazon Linux 2023</li><li>Docker</li><li>Nginx</li><li>Linux CLI</li><li>Containerization</li></ul><p>This stack is commonly used in <strong>DevOps learning and real-world environments</strong>.</p><h3>Project Architecture</h3><pre>User Browser<br>   |<br>   | HTTP (Port 80)<br>   ↓<br>AWS EC2 Instance<br>   |<br>   | Port Mapping (80:80)<br>   ↓<br>Docker Container (Nginx)</pre><p>The most important concept here is <strong>port mapping</strong>, which allows traffic from the host machine to reach the container.</p><h3>Step 1: Launching the EC2 Instance</h3><p>I launched an EC2 instance using <strong>Amazon Linux 2023</strong>.</p><p>Important points to check:</p><ul><li>Port <strong>80</strong> must be allowed in the security group</li><li>The instance should have internet access to pull Docker images</li></ul><p>After the instance was running, I connected to it using SSH.</p><h3>Step 2: Installing Docker on Amazon Linux</h3><p>Docker was installed using the default package manager:</p><pre>yum install docker -y</pre><p>This command installs Docker along with required dependencies.</p><p>Once installation was completed, Docker was available on the system.</p><h3>Step 3: Starting and Enabling Docker Service</h3><p>Docker runs as a system service, so it needs to be started and enabled:</p><pre>systemctl start docker<br>systemctl enable docker<br>systemctl status docker</pre><p>This step helped me understand that Docker is managed just like any other Linux service using <strong>systemd</strong>.</p><h3>Step 4: Pulling and Running the Nginx Container</h3><p>First, I checked existing Docker images:</p><pre>docker images</pre><p>Then I ran the Nginx container:</p><pre>docker run -d -p 80:80 --name my_nginx nginx</pre><p>This command does several things:</p><ul><li>Pulls the official <strong>Nginx image</strong> from Docker Hub</li><li>Runs the container in detached mode</li><li>Maps <strong>host port 80 to container port 80</strong></li><li>Assigns a name to the container</li></ul><p>This is where Docker really starts to make sense.</p><h3>Step 5: Verifying the Running Container</h3><p>To confirm that the container is running:</p><pre>docker ps</pre><p>The output showed the Nginx container running successfully.</p><p>At this point, Nginx was running <strong>inside the container</strong>, not directly on the EC2 operating system.</p><h3>Step 6: Accessing Nginx from the Browser</h3><p>I opened the EC2 public IP in a web browser:</p><pre>http://&lt;EC2_PUBLIC_IP&gt;</pre><p>The default <strong>Nginx welcome page</strong> appeared, confirming that:</p><ul><li>Docker container is running</li><li>Port mapping is working correctly</li><li>The application is accessible from the internet</li></ul><p>This step clearly shows the power of containerization.</p><h3>Key Learnings from This Project</h3><p>Through this project, I learned:</p><ul><li>How Docker works on an AWS EC2 instance</li><li>The difference between Docker images and containers</li><li>How port mapping exposes container applications</li><li>Why Docker simplifies application deployment</li><li>How containers behave in a real cloud environment</li></ul><p>More importantly, I learned <strong>why Docker is used</strong>, not just how to run commands.</p><h3>Real-World Use Cases</h3><p>This type of setup is commonly used for:</p><ul><li>Learning Docker fundamentals</li><li>Hosting containerized web applications</li><li>DevOps hands-on practice</li><li>CI/CD pipeline foundations</li><li>Microservices architecture basics</li></ul><p>Almost every DevOps journey starts with a project like this.</p><h3>Conclusion</h3><p>This project helped me understand Docker from a <strong>practical perspective</strong>.</p><p>Instead of only memorizing commands, I focused on:</p><ul><li>How traffic flows from browser to container</li><li>How Docker interacts with the host system</li><li>How applications are exposed using port mapping</li></ul><p>This project forms a strong foundation for learning <strong>Dockerfiles, Docker Compose, and Kubernetes</strong> next.</p><h3>Author</h3><p><strong>Raj Ahire</strong><br>DevOps &amp; Cloud Enthusiast</p><p>GitHub: <a href="https://github.com/RajAhire-1">https://github.com/RajAhire-1</a><br>LinkedIn: <a href="https://www.linkedin.com/in/raj-ahire">https://www.linkedin.com/in/raj-ahire</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d25d2888a89" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I Started Using Docker and the Problem It Really Solves]]></title>
            <link>https://medium.com/@rajahire326/why-i-started-using-docker-and-the-problem-it-really-solves-a7aec4749be7?source=rss-e832a56c2bd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7aec4749be7</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ansible]]></category>
            <dc:creator><![CDATA[Raj Ahire]]></dc:creator>
            <pubDate>Thu, 25 Dec 2025 06:47:50 GMT</pubDate>
            <atom:updated>2025-12-25T06:47:50.516Z</atom:updated>
            <content:encoded><![CDATA[<p>When I started working with applications, things looked simple at first.<br>I would install the required packages, run the application, and everything worked fine on my laptop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*owcK8fOwIcDjwiCKaVj4kQ.png" /></figure><p>The problem started when the same application was run somewhere else.</p><p>On another system, it behaved differently.<br>On the server, it sometimes didn’t run at all.</p><p>That’s when I first heard (and later said myself) this line:</p><blockquote><em>“It works on my machine.”</em></blockquote><p>At that time, I didn’t realize how serious this problem actually was.</p><h3>The Problem Is Not the Code</h3><p>Initially, I thought the issue was bad code or missing logic.<br>But after facing the same situation multiple times, I realized something important.</p><p>The code was the same.<br>The problem was the <strong>environment</strong>.</p><p>Different systems had:</p><ul><li>Different OS versions</li><li>Different library versions</li><li>Different configurations</li><li>Missing dependencies</li></ul><p>Even a small difference was enough to break the application.</p><p>This is where a lot of time gets wasted — not in building features, but in fixing environment issues.</p><h3>How Things Were Done Traditionally</h3><p>Before containers, the common approach was:</p><ul><li>Write setup instructions in a document</li><li>Ask others to install everything manually</li><li>Debug issues when something didn’t match</li></ul><p>This works only up to a point.</p><p>As soon as:</p><ul><li>More developers join</li><li>Applications move to servers</li><li>Deployments become frequent</li></ul><p>manual setup becomes painful and unreliable.</p><p>That’s when I understood that <strong>manual environment management does not scale</strong>.</p><h3>Why Containers Exist</h3><p>Containers were created to solve this exact problem.</p><p>Instead of explaining how to prepare an environment, containers <strong>define the environment itself</strong>.</p><p>The idea is simple:</p><ul><li>Package the application</li><li>Include everything it needs to run</li><li>Run it the same way everywhere</li></ul><p>So whether the application runs on:</p><ul><li>A developer’s laptop</li><li>A testing server</li><li>A production server</li></ul><p>the environment stays consistent.</p><p>This concept made immediate sense to me.</p><h3>What Docker Means to Me (Not a Definition)</h3><p>I’m not going to give a textbook definition of Docker.</p><p>From my understanding, Docker helps answer one simple question:</p><blockquote><em>“How can I make sure my application runs the same everywhere?”</em></blockquote><p>Docker does this by:</p><ul><li>Creating images that describe the environment</li><li>Running containers from those images</li><li>Keeping dependencies isolated</li></ul><p>This removes a lot of guesswork during deployments.</p><h3>Why Docker Fits Naturally in DevOps</h3><p>As I started learning DevOps concepts, Docker kept coming up again and again.</p><p>DevOps focuses on:</p><ul><li>Automation</li><li>Consistency</li><li>Faster deployments</li><li>Fewer failures</li></ul><p>Docker supports all of this.</p><p>With Docker:</p><ul><li>Environments are predictable</li><li>CI/CD pipelines become easier</li><li>Deployments are faster</li><li>Debugging becomes simpler</li></ul><p>That’s why Docker is so widely used in modern DevOps workflows.</p><h3>Docker Is Not Magic</h3><p>One thing I want to be clear about:<br>Docker is not a magic solution.</p><p>You still need:</p><ul><li>Linux basics</li><li>Networking understanding</li><li>Monitoring and security knowledge</li></ul><p>Docker makes things easier, but only when the fundamentals are clear.</p><h3>Why I Decided to Start Learning Docker</h3><p>I chose to start Docker now because:</p><ul><li>I already had basic Linux knowledge</li><li>I was working with cloud servers</li><li>I was learning automation tools like Ansible and Terraform</li></ul><p>Docker felt like the next logical step, not something random.</p><h3>Final Thoughts</h3><p>For me, Docker is not about memorizing commands.</p><p>It is about solving a very real problem:<br><strong>environment inconsistency</strong>.</p><p>Understanding why Docker exists made learning it much easier.<br>Instead of feeling like “another tool”, it started to feel like a solution.</p><p>In the next blog, I’ll share my experience running my <strong>first Docker container</strong> and what I learned from it.</p><p><strong>Written by:</strong><br><strong>Raj Ahire</strong><br>AWS | DevOps | Docker | Terraform | Ansible</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7aec4749be7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Nginx on AWS EC2 Using Ansible Handlers (My Practical Notes)]]></title>
            <link>https://medium.com/@rajahire326/deploying-nginx-on-aws-ec2-using-ansible-handlers-my-practical-notes-60a982d16f97?source=rss-e832a56c2bd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/60a982d16f97</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Raj Ahire]]></dc:creator>
            <pubDate>Fri, 19 Dec 2025 11:41:13 GMT</pubDate>
            <atom:updated>2025-12-19T11:41:13.901Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploying Nginx on AWS EC2 Using Ansible Handlers</h3><p>While learning Ansible, one concept that kept coming up in real-world discussions was <strong>handlers</strong>.<br>At first, handlers sounded simple, but I wanted to understand <strong>why they matter in production environments</strong> and how they are actually used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qKYktXcjPJQsmteZhEoolA.png" /></figure><h3>Why I Chose This Use Case</h3><p>In real DevOps environments, services should not restart unnecessarily.<br>Restarting or reloading a service every time a playbook runs can cause:</p><ul><li>Unnecessary service interruptions</li><li>Increased deployment time</li><li>Risk in production environments</li></ul><p>This is exactly the problem <strong>Ansible handlers are designed to solve</strong>.</p><p>So instead of just installing Nginx, I decided to:</p><ul><li>Change the Nginx configuration</li><li>Deploy a custom web page</li><li>Reload Nginx <strong>only when the configuration actually changes</strong></li></ul><h3>Project Overview</h3><p>This project automates the following on a <strong>target AWS EC2 server</strong>:</p><ul><li>Installation of Nginx</li><li>Starting and enabling the Nginx service</li><li>Configuration of Nginx to listen on a <strong>custom port (777)</strong></li><li>Deployment of a custom HTML page</li><li>Automatic reload of Nginx using <strong>Ansible handler</strong></li></ul><p>The automation is executed from an <strong>Ansible control node</strong>, which connects to the target server via SSH.</p><h3>Architecture Overview</h3><p>The setup consists of two EC2 instances:</p><ul><li><strong>Ansible Control Node</strong><br>Used to execute Ansible playbooks and manage infrastructure.</li><li><strong>Target Server</strong><br>Runs Nginx and serves the web application on port 777.</li></ul><p>This separation reflects how Ansible is commonly used in real environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K_ht3pFt4qY01ujdbBr8UA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*80Y4t1TW3lRRnUOVqEtNCw.png" /></figure><h3>Tools and Technologies Used</h3><p>For this project, I used:</p><ul><li>AWS EC2 (Amazon Linux)</li><li>Ansible</li><li>Nginx</li><li>SSH</li><li>Linux (RHEL-based)</li><li>Infrastructure automation practices</li></ul><h3>How the Ansible Playbook Works</h3><p>The playbook performs the deployment in a clean and predictable way.</p><p>High-level flow:</p><ol><li>Install the Nginx package using the dnf module</li><li>Start and enable the Nginx service using systemd_service</li><li>Add a custom Nginx configuration using blockinfile</li><li>Notify a handler when the configuration changes</li><li>Reload Nginx only when notified</li><li>Deploy a custom HTML file to the web root</li></ol><p>The key part here is the <strong>handler</strong>, which reloads Nginx <strong>only if the configuration file is modified</strong>.</p><h3>Why Handlers Matter in Real DevOps Work</h3><p>Handlers introduce <strong>event-driven behavior</strong> into automation.</p><p>Instead of blindly restarting services, Ansible waits for a change and then triggers the handler.</p><p>This brings several benefits:</p><ul><li>Prevents unnecessary service reloads</li><li>Improves deployment efficiency</li><li>Reduces risk during production changes</li><li>Makes playbooks predictable and safe</li></ul><p>In this project, the Nginx service reload happens <strong>only when the configuration block changes</strong>.</p><h3>Execution and Verification</h3><p>After running the playbook, I verified the setup by:</p><ul><li>Checking the Ansible playbook output (no failures or unnecessary changes)</li><li>Accessing the Nginx application using the EC2 public IP on port <strong>777</strong></li><li>Confirming that the custom HTML page was served correctly</li></ul><p>Successful verification confirmed that the handler logic worked as expected.</p><h3>Real-World Use Cases</h3><p>This automation pattern is commonly used in:</p><ul><li>Production server configuration</li><li>Zero-downtime deployments</li><li>CI/CD pipeline</li><li>Cloud infrastructure automation</li><li>Standardized server provisioning</li></ul><p>Handlers are especially important when managing critical services.</p><h3>What I Learned from This Project</h3><p>This project helped me clearly understand:</p><ul><li>How Ansible handlers work internally</li><li>Why idempotency is critical in automation</li><li>How to safely manage service reloads</li><li>How configuration changes should drive service behavior</li><li>How Ansible is used in real DevOps workflows</li></ul><p>It also reinforced the idea that <strong>good automation is not just about making things work, but making them work safely</strong>.</p><h3>Final Thoughts</h3><p>This project may look simple, but it reflects a <strong>very real DevOps practice</strong>.<br>Using handlers correctly can make a big difference in how reliable and production-ready your automation is.</p><p>Working on this helped me move beyond theory and understand how Ansible is used in real environments to manage infrastructure changes cleanly and efficiently.</p><p><strong>Written by:</strong><br><strong>Raj Ahire</strong><br>AWS | DevOps | Terraform | Ansible | Automation</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60a982d16f97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a 3-Tier Architecture on AWS Using Ansible Automation]]></title>
            <link>https://medium.com/@rajahire326/deploying-a-3-tier-architecture-on-aws-using-ansible-automation-a1d127afa860?source=rss-e832a56c2bd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1d127afa860</guid>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Raj Ahire]]></dc:creator>
            <pubDate>Thu, 18 Dec 2025 15:26:51 GMT</pubDate>
            <atom:updated>2025-12-18T15:26:51.904Z</atom:updated>
            <content:encoded><![CDATA[<p>In modern cloud environments, automation and clean architecture design are essential.<br>In this article, I will explain how I deployed a <strong>3-Tier Architecture on AWS EC2 instances using Ansible</strong>, where the entire setup is automated without manual configuration on servers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x6mkGcnRbdn6t0atVpg4Xw.png" /></figure><h3>What Is a 3-Tier Architecture?</h3><p>A <strong>3-Tier Architecture</strong> is a standard architectural pattern used in production environments.<br>It separates an application into three logical layers:</p><ol><li><strong>Proxy / Presentation Layer</strong></li><li><strong>Application Layer</strong></li><li><strong>Database Layer</strong></li></ol><p>Each tier has a specific responsibility, which improves <strong>scalability, security, and maintainability</strong>.</p><p>In this project, I implemented the following flow:</p><p>Client Browser → Proxy Server → Application Server → Database Server</p><h3>Architecture Overview</h3><p>The architecture consists of three AWS EC2 instances:</p><ul><li><strong>Proxy Server</strong></li><li>Runs Nginx as a reverse proxy</li><li>Listens on a custom port</li><li>Forwards client requests to the application server</li><li><strong>Application Server</strong></li><li>Runs Nginx with PHP and PHP-FPM</li><li>Processes application logic</li><li>Communicates with the database server</li><li><strong>Database Server</strong></li><li>Runs MariaDB</li><li>Stores application data securely</li></ul><p>All servers are provisioned and configured automatically using <strong>Ansible</strong>.</p><h3>Why Ansible?</h3><p>Ansible is an agentless automation tool widely used in DevOps environments.</p><p>I chose Ansible because:</p><ul><li>No agents are required on target servers</li><li>Configuration is written in human-readable YAML</li><li>It ensures consistency across servers</li><li>It eliminates manual setup errors</li></ul><p>Using Ansible, the entire infrastructure setup can be reproduced with a single command.</p><h3>Technology Stack Used</h3><ul><li><strong>Cloud Platform:</strong> AWS EC2 (Amazon Linux)</li><li><strong>Automation Tool:</strong> Ansible</li><li><strong>Web Server:</strong> Nginx</li><li><strong>Application Runtime:</strong> PHP with PHP-FPM</li><li><strong>Database:</strong> MariaDB</li><li><strong>Architecture Pattern:</strong> 3-Tier Architecture</li></ul><p>This combination closely matches real production environments.</p><h3>Project Structure</h3><p>The project is organized in a clean and simple structure:</p><ul><li>An Ansible playbook for configuring all servers</li><li>An inventory file defining proxy, application, and database servers</li><li>A dedicated folder for architecture and verification screenshots</li></ul><p>This structure makes the project easy to understand and maintain.</p><h3>Deployment Process</h3><p>The deployment process is straightforward:</p><ol><li>Clone the repository</li><li>Update the Ansible inventory with EC2 private IP addresses</li><li>Run a single Ansible playbook</li><li>Verify services on each server</li><li>Access the application through the proxy server</li></ol><p>Once the playbook runs successfully, the complete architecture is ready.</p><h3>Verification and Validation</h3><p>After deployment, I verified:</p><ul><li>Nginx is running on the proxy server and listening on a custom port</li><li>Traffic is correctly forwarded to the application server</li><li>PHP is executed successfully using PHP-FPM</li><li>MariaDB is installed and the database is created</li><li>No manual configuration was required on any server</li></ul><p>This confirms that the automation works end-to-end.</p><h3>Why This Project Is Important for DevOps</h3><p>This project demonstrates several key DevOps skills:</p><ul><li>Infrastructure automation using Ansible</li><li>Understanding of layered architecture</li><li>AWS EC2 hands-on experience</li><li>Service configuration and validation</li><li>Clean documentation and reproducibility</li></ul><p>It reflects how real teams deploy and manage applications in cloud environments.</p><h3>Interview Perspective</h3><p>If asked in an interview, this project can be explained as:</p><blockquote><em>“I deployed a 3-tier architecture on AWS where Nginx acts as a reverse proxy, forwarding requests to an application server running PHP. The application server connects to a MariaDB database backend. The entire setup is automated using Ansible, ensuring consistency, repeatability, and minimal manual intervention.</em></blockquote><p>This shows both <strong>technical depth and practical experience</strong>.</p><h3>Conclusion</h3><p>This project helped me strengthen my understanding of <strong>AWS, Ansible, and system architecture</strong>.<br>It demonstrates how automation simplifies infrastructure management and reduces human error.</p><p>If you are learning DevOps or preparing for interviews, building projects like this is extremely valuable.</p><h3>Author</h3><p><strong>Raj Ahire</strong><br>LinkedIn: <a href="https://www.linkedin.com/in/raj-ahire">https://www.linkedin.com/in/raj-ahire</a><br>Medium: <a href="https://medium.com/@rajahire326">https://medium.com/@rajahire326</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1d127afa860" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating from LEMP to LAMP Stack on Amazon Linux Using Ansible]]></title>
            <link>https://medium.com/@rajahire326/migrating-from-lemp-to-lamp-stack-on-amazon-linux-using-ansible-19075837d21a?source=rss-e832a56c2bd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/19075837d21a</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ansible]]></category>
            <dc:creator><![CDATA[Raj Ahire]]></dc:creator>
            <pubDate>Wed, 17 Dec 2025 13:44:16 GMT</pubDate>
            <atom:updated>2025-12-17T13:44:16.003Z</atom:updated>
            <content:encoded><![CDATA[<p>While working with Linux servers and DevOps tools, one common situation I came across was this:<br><strong>servers are already running with a specific stack, and we are asked to change it without breaking the system</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RlZiJFBb7vqGWz3wjn5x5A.png" /></figure><p>In many real environments, Nginx is initially installed, but later requirements change and the organization wants Apache instead. Doing this manually can be risky and error-prone.</p><p>To understand how such migrations are handled in practice, I worked on a small but realistic project — <strong>automating the migration from a LEMP stack to a LAMP stack using Ansible on Amazon Linux</strong>.</p><p>This blog explains my approach, what I learned, and why automation matters here.</p><h3>Why This Migration Matters</h3><p>A LEMP stack (Linux, Nginx, MariaDB, PHP) and a LAMP stack (Linux, Apache, MariaDB, PHP) are both widely used.<br>The difference mainly lies in the web server.</p><p>In real-world DevOps work:</p><ul><li>Servers are rarely rebuilt from scratch</li><li>Changes must be controlled and reversible</li><li>Downtime should be minimal</li><li>Manual steps should be avoided</li></ul><p>This makes <strong>automation tools like Ansible</strong> a perfect fit for such tasks.</p><h3>Project Goal</h3><p>The goal of this project was simple but practical:</p><ul><li>Remove Nginx from an existing server</li><li>Install and configure Apache instead</li><li>Keep MariaDB and PHP stable</li><li>Ensure all required services are running</li><li>Verify the setup using a web page</li></ul><p>All of this needed to be done using <strong>one Ansible playbook</strong>, executed on a <strong>remote target server</strong>.</p><h3>Environment and Tools Used</h3><p>For this project, I used:</p><ul><li><strong>Operating System:</strong> Amazon Linux</li><li><strong>Automation Tool:</strong> Ansible</li><li><strong>Web Server:</strong> Apache (httpd)</li><li><strong>Database:</strong> MariaDB</li><li><strong>Backend Language:</strong> PHP and PHP-FPM</li><li><strong>Inventory:</strong> Static inventory file</li></ul><p>This setup closely matches a typical AWS EC2 environment.</p><h3>How the Automation Works</h3><p>The Ansible playbook connects to a remote target server using SSH credentials defined in the inventory file.</p><p>The playbook performs the following actions in sequence:</p><ol><li>Removes the Nginx package and disables its service</li><li>Installs Apache (httpd)</li><li>Installs MariaDB</li><li>Installs PHP and PHP-FPM</li><li>Starts and enables Apache, MariaDB, and PHP-FPM services</li><li>Deploys a simple web file to verify Apache is serving content</li></ol><p>All tasks are <strong>idempotent</strong>, which means the playbook can be run multiple times safely without causing issues.</p><h3>Inventory-Based Remote Execution</h3><p>Instead of running tasks on localhost, this project uses a <strong>target server defined in an inventory file</strong>.</p><p>This reflects real production usage where:</p><ul><li>Ansible control node is separate</li><li>Multiple servers can be managed</li><li>Access is handled securely using SSH keys</li></ul><p>This approach makes the automation scalable and reusable.</p><h3>Execution and Verification</h3><p>After running the playbook, I verified the setup by checking:</p><ul><li>Nginx was fully removed and disabled</li><li>Apache was running and serving content</li><li>MariaDB service was active</li><li>PHP-FPM was running correctly</li><li>The web page loaded successfully through Apache</li></ul><p>Successful verification confirmed that the system was converted from <strong>LEMP to LAMP</strong> without manual intervention.</p><h3>What I Learned from This Project</h3><p>This project helped me understand several important DevOps concepts:</p><ul><li>Why automation is critical for infrastructure changes</li><li>How Ansible simplifies service management</li><li>How to safely replace components on a running system</li><li>The importance of idempotency in configuration management</li><li>How real-world migrations differ from fresh installations</li></ul><p>It also strengthened my confidence in using Ansible for practical server automation.</p><h3>Why Ansible Is a Good Fit Here</h3><p>Ansible works well for this use case because:</p><ul><li>It is agentless</li><li>Uses simple YAML-based playbooks</li><li>Provides predictable and repeatable results</li><li>Reduces human error during migrations</li><li>Can be extended easily for larger environments</li></ul><p>This makes it suitable for both small setups and enterprise-scale infrastructure.</p><h3>Final Thoughts</h3><p>This project may look simple, but it reflects a <strong>very common real-world DevOps scenario</strong>.<br>Replacing a web server on an existing system is something that must be done carefully, and automation makes it reliable.</p><p>Working on this project helped me move beyond theory and understand how Ansible is used in real environments to manage change safely.</p><p><strong>Written by:</strong><br><strong>Raj Ahire</strong><br>AWS | DevOps | Terraform | Ansible | Automation</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19075837d21a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Converting LEMP Stack to LAMP Stack Using Ansible on Amazon Linux]]></title>
            <link>https://medium.com/@rajahire326/converting-lemp-stack-to-lamp-stack-using-ansible-on-amazon-linux-da1b5bc0ef76?source=rss-e832a56c2bd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/da1b5bc0ef76</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[viral]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Raj Ahire]]></dc:creator>
            <pubDate>Tue, 16 Dec 2025 14:24:07 GMT</pubDate>
            <atom:updated>2025-12-16T14:24:07.161Z</atom:updated>
            <content:encoded><![CDATA[<p>When working with real-world infrastructure, we often inherit systems that are already configured in a certain way. One common scenario is encountering a <strong>LEMP stack (Linux, Nginx, MariaDB, PHP)</strong> when the project or organization standard requires a <strong>LAMP stack (Linux, Apache, MariaDB, PHP)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IJuj82XE8DkueBbn21Xw1Q.png" /></figure><p>In this article, I’ll walk through how I <strong>converted a running LEMP stack into a LAMP stack using Ansible</strong> on an <strong>Amazon Linux EC2 instance</strong>, in a clean, automated, and repeatable way.</p><p>This was not just a fresh installation — the goal was <strong>controlled migration</strong>, which is a very real DevOps use case.</p><h3>Why Convert LEMP to LAMP?</h3><p>Both stacks are popular and powerful, but Apache is still widely used in enterprise environments due to:</p><ul><li>Compatibility with legacy applications</li><li>Rich module ecosystem</li><li>Familiarity for operations teams</li></ul><p>Instead of manually uninstalling and installing services, I chose <strong>Ansible</strong> to automate the conversion. This ensures:</p><ul><li>Consistency</li><li>Idempotency</li><li>Easy reuse across environments</li></ul><h3>Environment Details</h3><ul><li>Operating System: Amazon Linux</li><li>Automation Tool: Ansible</li><li>Initial Stack: LEMP (Nginx, MariaDB, PHP)</li><li>Target Stack: LAMP (Apache, MariaDB, PHP)</li></ul><p>The Ansible playbook was executed locally on the EC2 instance using localhost.</p><h3>Automation Strategy</h3><p>The conversion followed a clear sequence:</p><ol><li>Stop and remove Nginx</li><li>Install Apache (httpd)</li><li>Ensure MariaDB is installed and running</li><li>Install PHP and PHP-FPM</li><li>Enable required services on boot</li><li>Deploy a PHP verification page</li></ol><p>All configurations were driven using <strong>Ansible variables</strong>, making the playbook clean and easy to modify.</p><h3>Variable-Driven Ansible Playbook</h3><p>Using variables allowed me to avoid hardcoding package and service names.</p><pre>web_sr: nginx<br>web_sr_2: httpd<br>db_sr: mariadb105-server<br>php_sr:<br>  - php<br>  - php-fpm<br>web_service: nginx<br>web_service_2: httpd<br>db_service: mariadb<br>php_service: php-fpm<br>web_file_path: /var/www/html/index.php</pre><p>This approach makes the playbook easier to maintain and extend.</p><h3>Key Tasks Performed by Ansible</h3><ul><li>Removed the Nginx package and disabled its service</li><li>Installed Apache HTTPD and enabled it</li><li>Installed and started MariaDB</li><li>Installed PHP and PHP-FPM</li><li>Deployed a custom index.php file using the Ansible copy module</li></ul><p>Each task was idempotent, meaning the playbook can be safely re-run without causing issues.</p><h3>Execution Results</h3><p>The Ansible playbook completed successfully with:</p><ul><li>Zero failures</li><li>All services running in the correct state</li><li>Apache serving PHP content correctly</li></ul><p>After execution, accessing the EC2 public IP confirmed that the system was now running on a <strong>LAMP stack</strong>, not LEMP.</p><h3>Verification</h3><p>The application was verified using:</p><pre>http://&lt;EC2-PUBLIC-IP&gt;/index.php</pre><p>The PHP page clearly confirms:</p><ul><li>Apache is the active web server</li><li>PHP is processed correctly</li><li>MariaDB service is running</li></ul><p>This confirms a successful stack conversion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bUalt0SYxj4WjKjh04re3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XTBAbqrRt-rErIJoD7DCow.png" /></figure><h3>Why This Project Matters</h3><p>This project demonstrates more than just package installation:</p><ul><li>Real-world infrastructure migration</li><li>Configuration management using Ansible</li><li>Service orchestration and dependency handling</li><li>Clean, readable automation code</li></ul><p>These are exactly the kinds of skills expected from a DevOps or Cloud Engineer in production environments.</p><h3>Possible Enhancements</h3><p>In the future, this automation can be improved by:</p><ul><li>Converting the playbook into Ansible roles</li><li>Adding inventory-based multi-host support</li><li>Securing MariaDB using Ansible</li><li>Adding SSL configuration with Let’s Encrypt</li></ul><h3>Final Thoughts</h3><p>Manual server changes don’t scale. Automation does.</p><p>This LEMP to LAMP conversion project reinforced how powerful Ansible can be when managing real infrastructure changes safely and efficiently. If you’re learning DevOps, projects like this are a great way to move beyond theory and into practical experience.</p><h3>About Me</h3><p>I am an AWS &amp; DevOps enthusiast, focused on automation, cloud infrastructure, and CI/CD practices.<br>I enjoy building hands-on projects that reflect real production scenarios.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da1b5bc0ef76" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>