<?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"><channel><title><![CDATA[Zidan's Blog]]></title><description><![CDATA[Zidan's Blog]]></description><link>https://zidans-blog.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 10:28:48 GMT</lastBuildDate><atom:link href="https://zidans-blog.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Deploying a Multi-Tier Application: The VProfile Project with Vagrant and VirtualBox]]></title><description><![CDATA[Introduction
In this blog, we’ll dive into the VProfile Project, a hands-on experience in building a scalable, multi-tier application. This project simulates a production-grade architecture using various tools and technologies, helping developers und...]]></description><link>https://zidans-blog.hashnode.dev/deploying-a-multi-tier-application-the-vprofile-project-with-vagrant-and-virtualbox</link><guid isPermaLink="true">https://zidans-blog.hashnode.dev/deploying-a-multi-tier-application-the-vprofile-project-with-vagrant-and-virtualbox</guid><category><![CDATA[Devops]]></category><category><![CDATA[deployment]]></category><category><![CDATA[projects]]></category><dc:creator><![CDATA[Zidan Niyas]]></dc:creator><pubDate>Sat, 30 Nov 2024 04:35:59 GMT</pubDate><content:encoded><![CDATA[<h3 id="heading-introduction">Introduction</h3>
<p>In this blog, we’ll dive into the <strong>VProfile Project</strong>, a hands-on experience in building a scalable, multi-tier application. This project simulates a production-grade architecture using various tools and technologies, helping developers understand how modern applications are structured and deployed.</p>
<hr />
<h2 id="heading-technologies-used"><strong>Technologies Used</strong></h2>
<p>The project uses multiple tools and services to create a distributed application environment:</p>
<h3 id="heading-infrastructure-setup"><strong>Infrastructure Setup:</strong></h3>
<ul>
<li><strong>Vagrant &amp; VirtualBox:</strong><br />  To provision and manage virtual machines (VMs) as separate service hosts.</li>
</ul>
<h3 id="heading-application-services"><strong>Application Services:</strong></h3>
<ol>
<li><p><strong>MySQL:</strong> Relational database for structured data storage.</p>
</li>
<li><p><strong>Memcache:</strong> Caching layer to reduce database load and improve response time.</p>
</li>
<li><p><strong>RabbitMQ:</strong> Message broker for handling asynchronous communication.</p>
</li>
<li><p><strong>Tomcat:</strong> Application server to run business logic.</p>
</li>
<li><p><strong>Nginx:</strong> Web server acting as a reverse proxy and traffic manager.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732941271188/6f11884b-809a-4880-b5a6-53660fb8b326.png" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-why-use-these-tools"><strong>Why Use These Tools?</strong></h2>
<p>Each tool plays a crucial role in a production-like setup:</p>
<ul>
<li><p><strong>VirtualBox and Vagrant:</strong> Enable easy provisioning and reproducibility of the development environment.</p>
</li>
<li><p><strong>MySQL:</strong> Provides reliable and efficient storage for application data.</p>
</li>
<li><p><strong>Memcache:</strong> Boosts application performance by caching frequently accessed data.</p>
</li>
<li><p><strong>RabbitMQ:</strong> Handles background tasks and decouples services.</p>
</li>
<li><p><strong>Tomcat:</strong> Serves as the backbone of the application, executing its logic.</p>
</li>
<li><p><strong>Nginx:</strong> Ensures smooth traffic flow and balances load.</p>
</li>
</ul>
<hr />
<h2 id="heading-how-it-works"><strong>How It Works</strong></h2>
<p>This is how the VProfile project operates in a multi-tier architecture:</p>
<h3 id="heading-1-provisioning-virtual-machines">1. <strong>Provisioning Virtual Machines:</strong></h3>
<ul>
<li><p>VirtualBox is used to host VMs.</p>
</li>
<li><p>Vagrant automates the setup of multiple VMs for services like MySQL, Memcache, RabbitMQ, Tomcat, and Nginx.</p>
</li>
</ul>
<h3 id="heading-2-service-deployment">2. <strong>Service Deployment:</strong></h3>
<ul>
<li><p>Each service runs on a dedicated VM.</p>
</li>
<li><p>Services are configured in a specific order:</p>
<ul>
<li><strong>MySQL</strong> → <strong>Memcache</strong> → <strong>RabbitMQ</strong> → <strong>Tomcat</strong> → <strong>Nginx</strong></li>
</ul>
</li>
</ul>
<h3 id="heading-3-application-flow">3. <strong>Application Flow:</strong></h3>
<ul>
<li><p>A <strong>client</strong> sends a request to the <strong>Nginx server</strong>.</p>
</li>
<li><p>Nginx forwards the request to the <strong>Tomcat application server</strong>.</p>
</li>
<li><p>Tomcat interacts with:</p>
<ul>
<li><p><strong>MySQL</strong> for database operations.</p>
</li>
<li><p><strong>Memcache</strong> to retrieve cached data.</p>
</li>
<li><p><strong>RabbitMQ</strong> for queuing background tasks.</p>
</li>
</ul>
</li>
<li><p>The response is sent back to Nginx, which serves it to the client.</p>
</li>
</ul>
<hr />
<h2 id="heading-step-by-step-project-flow"><strong>Step-by-Step Project Flow</strong></h2>
<h3 id="heading-1-infrastructure-setup"><strong>1. Infrastructure Setup</strong></h3>
<ul>
<li><p>Install VirtualBox and Vagrant.</p>
</li>
<li><p>Clone the project repository (<a target="_blank" href="https://github.com/hkhcoder/vprofile-project.git">https://github.com/hkhcoder/vprofile-project.git</a>) and run:</p>
<pre><code class="lang-bash">  vagrant up
</code></pre>
</li>
<li><p>This brings up all the VMs.</p>
</li>
</ul>
<h3 id="heading-2-service-configuration"><strong>2. Service Configuration</strong></h3>
<p>Set up the services in the following order. Each service runs on its designated VM, provisioned by Vagrant.</p>
<h3 id="heading-step-1-mysql-database"><strong>Step 1: MySQL (Database)</strong></h3>
<ol>
<li><p>SSH into the database VM:</p>
<pre><code class="lang-bash"> vagrant ssh db01
</code></pre>
</li>
<li><p>Install MariaDB and secure the database:</p>
<pre><code class="lang-bash"> sudo dnf install mariadb-server -y
 sudo systemctl start mariadb
 sudo mysql_secure_installation
</code></pre>
</li>
<li><p>Create the <code>accounts</code> database and import the schema from the source code:</p>
<pre><code class="lang-bash"> mysql -u root -p &lt; /path/to/db_backup.sql
</code></pre>
</li>
</ol>
<hr />
<h3 id="heading-step-2-memcache-caching-service"><strong>Step 2: Memcache (Caching Service)</strong></h3>
<ol>
<li><p>SSH into the caching VM:</p>
<pre><code class="lang-bash"> vagrant ssh mc01
</code></pre>
</li>
<li><p>Install and configure Memcache:</p>
<pre><code class="lang-bash"> sudo dnf install memcached -y
 sudo systemctl start memcached
</code></pre>
</li>
<li><p>Adjust the configuration to allow external connections.</p>
</li>
</ol>
<hr />
<h3 id="heading-step-3-rabbitmq-message-broker"><strong>Step 3: RabbitMQ (Message Broker)</strong></h3>
<ol>
<li><p>SSH into the RabbitMQ VM:</p>
<pre><code class="lang-bash"> vagrant ssh rmq01
</code></pre>
</li>
<li><p>Install RabbitMQ and enable it:</p>
<pre><code class="lang-bash"> sudo dnf install rabbitmq-server -y
 sudo systemctl start rabbitmq-server
</code></pre>
</li>
<li><p>Create a user and configure permissions.</p>
</li>
</ol>
<hr />
<h3 id="heading-step-4-tomcat-application-server"><strong>Step 4: Tomcat (Application Server)</strong></h3>
<ol>
<li><p>SSH into the Tomcat VM:</p>
<pre><code class="lang-bash"> vagrant ssh app01
</code></pre>
</li>
<li><p>Install Java, Tomcat, and Maven.</p>
</li>
<li><p>Clone the source code, build the application with Maven, and deploy the WAR file to Tomcat.</p>
</li>
</ol>
<hr />
<h3 id="heading-step-5-nginx-web-server"><strong>Step 5: Nginx (Web Server)</strong></h3>
<ol>
<li><p>SSH into the Nginx VM:</p>
<pre><code class="lang-bash"> vagrant ssh web01
</code></pre>
</li>
<li><p>Install Nginx and configure it as a reverse proxy to route requests to Tomcat.</p>
</li>
</ol>
<hr />
<h3 id="heading-for-detailed-commands"><strong>For Detailed Commands</strong></h3>
<p>If you're new to setting up these services, refer to the <a target="_blank" href="https://github.com/hkhcoder/vprofile-project">VProfile GitHub Repository</a> for step-by-step instructions.</p>
<h3 id="heading-3-application-flow-1"><strong>3. Application Flow</strong></h3>
<ul>
<li><p>Nginx routes user requests to Tomcat.</p>
</li>
<li><p>Tomcat processes the logic and interacts with the database, cache, or message queue as required.</p>
</li>
<li><p>A response is generated and sent back to the client.</p>
</li>
</ul>
<hr />
<h2 id="heading-key-learning-outcomes"><strong>Key Learning Outcomes</strong></h2>
<p>By the end of this project, you will:</p>
<ul>
<li><p>Understand <strong>multi-tier application architecture</strong>.</p>
</li>
<li><p>Learn to set up and configure services like MySQL, Memcache, RabbitMQ, Tomcat, and Nginx.</p>
</li>
<li><p>Gain hands-on experience with <strong>Linux commands</strong>, <strong>networking</strong>, and <strong>firewall rules</strong>.</p>
</li>
<li><p>Explore how caching and asynchronous communication improve performance.</p>
</li>
<li><p>Experience the importance of <strong>reproducible environments</strong> in development using Vagrant.</p>
</li>
</ul>
<hr />
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>The <strong>VProfile Project</strong> is an excellent way to learn about deploying and managing production-like applications. It introduces you to essential tools and technologies widely used in real-world systems</p>
]]></content:encoded></item><item><title><![CDATA[Is Vagrant still relevant in 2024?]]></title><description><![CDATA[Vagrant has long been a go-to tool for setting up consistent virtual environments, especially in development and testing scenarios. By enabling engineers to easily provision virtual machines with custom configurations, it remains ideal for testing in...]]></description><link>https://zidans-blog.hashnode.dev/is-vagrant-still-relevant-in-2024</link><guid isPermaLink="true">https://zidans-blog.hashnode.dev/is-vagrant-still-relevant-in-2024</guid><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Zidan Niyas]]></dc:creator><pubDate>Sat, 16 Nov 2024 11:26:43 GMT</pubDate><content:encoded><![CDATA[<p>Vagrant has long been a go-to tool for setting up consistent virtual environments, especially in development and testing scenarios. By enabling engineers to easily provision virtual machines with custom configurations, it remains ideal for testing infrastructure-as-code (IaC) or simulating production-like environments locally.</p>
<p>However, the landscape has shifted. The rise of containerization technologies like Docker and orchestration platforms such as Kubernetes has reduced Vagrant's prominence, especially in production workflows. Containers offer lightweight and faster alternatives for deploying and managing applications, while tools like Terraform have revolutionized infrastructure provisioning at scale.</p>
<h3 id="heading-where-vagrant-still-shines"><strong>Where Vagrant Still Shines</strong></h3>
<p>Despite this shift, Vagrant continues to be a reliable tool in specific use cases:</p>
<ol>
<li><p><strong>Isolated Development Environments</strong>: Vagrant excels in creating reproducible environments for developers working on different operating systems. For instance, a team of developers on Windows or macOS can use Vagrant to set up a Linux-based environment that mirrors the staging or production environment.</p>
</li>
<li><p><strong>Learning Infrastructure Automation</strong>: Beginners often find Vagrant valuable for understanding infrastructure automation and exploring tools like Ansible, Puppet, or Chef in a controlled setting.</p>
</li>
<li><p><strong>Legacy System Support</strong>: Vagrant plays a critical role in maintaining or developing applications that rely on virtual machines. This is especially important in industries where containers aren't a feasible option due to compliance, compatibility, or other technical constraints.</p>
</li>
<li><p><strong>Multi-VM Testing</strong>: When testing complex systems requiring multiple virtual machines (e.g., clusters or distributed systems), Vagrant simplifies the setup and teardown process, enabling quick iterations.</p>
</li>
</ol>
<h3 id="heading-challenges-vagrant-faces"><strong>Challenges Vagrant Faces</strong></h3>
<ol>
<li><p><strong>Performance</strong>: Compared to containers, virtual machines are heavier and slower, making Vagrant less appealing in fast-paced development cycles.</p>
</li>
<li><p><strong>Containerization Dominance</strong>: Tools like Docker and Kubernetes dominate modern workflows due to their efficiency and alignment with cloud-native practices.</p>
</li>
<li><p><strong>Cloud-based Development</strong>: Services like GitHub Codespaces and AWS Cloud9 are reducing the need for local virtualized environments, further limiting Vagrant's appeal.</p>
</li>
</ol>
<h3 id="heading-practical-scenarios-for-vagrant-in-2024"><strong>Practical Scenarios for Vagrant in 2024</strong></h3>
<p>While modern DevOps practices increasingly favor tools like Jenkins, Terraform, Docker, and Kubernetes, Vagrant still finds a niche in bridging gaps where virtual machines remain necessary. For example:</p>
<ul>
<li><p><strong>University Projects</strong>: Students and educators use Vagrant to simulate production-like environments for learning.</p>
</li>
<li><p><strong>Legacy Systems</strong>: An enterprise working with a monolithic architecture might rely on Vagrant to test new configurations before deploying updates.</p>
</li>
<li><p><strong>Hybrid Architectures</strong>: Teams managing environments with both VMs and containers may use Vagrant to set up local VM testing environments while containerizing other parts of their stack.</p>
</li>
</ul>
<h3 id="heading-conclusion"><strong>Conclusion</strong></h3>
<p>While Vagrant is no longer the primary tool for DevOps in 2024, it retains its relevance in specific scenarios. Its ability to simplify virtual machine provisioning and create isolated, reproducible environments makes it a valuable addition to an engineer’s toolkit—particularly when working with legacy systems, learning IaC, or handling hybrid architectures.</p>
<p>As the DevOps landscape continues to evolve, Vagrant's role may become more niche, but it remains a reliable and useful tool for those who understand its strengths and limitations.</p>
]]></content:encoded></item><item><title><![CDATA[Week 2/12 : Simulating Real-World Infrastructure with Multi-VM Vagrant Environments]]></title><description><![CDATA[In this blog, we’ll explore how to create a multi-VM environment using Vagrant. This setup simulates real-world production architectures, making it ideal for testing, development, and learning purposes. Here’s everything you need to know to get start...]]></description><link>https://zidans-blog.hashnode.dev/week-212-simulating-real-world-infrastructure-with-multi-vm-vagrant-environments</link><guid isPermaLink="true">https://zidans-blog.hashnode.dev/week-212-simulating-real-world-infrastructure-with-multi-vm-vagrant-environments</guid><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Zidan Niyas]]></dc:creator><pubDate>Thu, 14 Nov 2024 08:20:03 GMT</pubDate><content:encoded><![CDATA[<p>In this blog, we’ll explore how to create a multi-VM environment using Vagrant. This setup simulates real-world production architectures, making it ideal for testing, development, and learning purposes. Here’s everything you need to know to get started!</p>
<hr />
<h2 id="heading-why-use-a-multi-vm-setup">Why Use a Multi-VM Setup?</h2>
<p>Multi-VM configurations in Vagrant allow you to simulate complex, distributed architectures. Here are some key benefits:</p>
<h3 id="heading-1-simulating-distributed-systems">1. <strong>Simulating Distributed Systems</strong></h3>
<ul>
<li>Allows simulation of separate components, such as web servers, databases, and caching servers, on individual VMs.</li>
</ul>
<h3 id="heading-2-isolation-of-services">2. <strong>Isolation of Services</strong></h3>
<ul>
<li>Each service runs in its own VM, mirroring production environments and minimizing dependency conflicts.</li>
</ul>
<h3 id="heading-3-testing-network-communication">3. <strong>Testing Network Communication</strong></h3>
<ul>
<li>Test inter-service communication and network configurations such as IP addresses and port forwarding in a realistic way.</li>
</ul>
<h3 id="heading-4-replicating-production-environments">4. <strong>Replicating Production Environments</strong></h3>
<ul>
<li>By mirroring production setups, multi-VM configurations make it easier to catch environment-specific issues early on.</li>
</ul>
<h3 id="heading-5-improved-team-collaboration">5. <strong>Improved Team Collaboration</strong></h3>
<ul>
<li>Vagrant environments are consistent across team members, which avoids “it works on my machine” issues.</li>
</ul>
<h3 id="heading-6-development-of-microservices-and-container-based-architectures">6. <strong>Development of Microservices and Container-Based Architectures</strong></h3>
<ul>
<li>Simulates microservice and container-based architectures for testing service-to-service communication, load balancing, and fault isolation.</li>
</ul>
<h3 id="heading-7-testing-failover-and-redundancy">7. <strong>Testing Failover and Redundancy</strong></h3>
<ul>
<li>Multi-VM setups allow you to test failover strategies, load balancing, and redundancy, essential for high-availability applications.</li>
</ul>
<hr />
<h2 id="heading-setting-up-your-multi-vm-vagrant-environment">Setting Up Your Multi-VM Vagrant Environment</h2>
<p>Follow these steps to create a multi-VM setup using Vagrant with two Ubuntu web servers (<code>web01</code> and <code>web02</code>) and one CentOS database server (<code>db01</code>), each with a private IP and custom hostname.</p>
<h3 id="heading-step-1-create-a-project-folder-and-vagrantfile">Step 1: Create a Project Folder and Vagrantfile</h3>
<ol>
<li><p>Open VS Code.</p>
</li>
<li><p>Create a new folder called <code>multivm</code>.</p>
</li>
<li><p>Inside the <code>multivm</code> folder, create a new file named <code>Vagrantfile</code>.</p>
</li>
</ol>
<h3 id="heading-step-2-add-the-multi-vm-vagrant-configuration">Step 2: Add the Multi-VM Vagrant Configuration</h3>
<p>Paste the following configuration into your <code>Vagrantfile</code>:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Multi-VM Vagrantfile with Ubuntu and CentOS VMs, private networking, and hostname setup</span>
Vagrant.configure(<span class="hljs-string">"2"</span>) <span class="hljs-keyword">do</span> |config|

    <span class="hljs-comment"># Define the first web server (web01)</span>
    config.vm.define <span class="hljs-string">"web01"</span> <span class="hljs-keyword">do</span> |web01|
      web01.vm.box = <span class="hljs-string">"ubuntu/focal64"</span>            <span class="hljs-comment"># Ubuntu 20.04</span>
      web01.vm.hostname = <span class="hljs-string">"web01"</span>                <span class="hljs-comment"># Set hostname</span>
      web01.vm.network <span class="hljs-string">"private_network"</span>, ip: <span class="hljs-string">"192.168.56.41"</span>   <span class="hljs-comment"># Set private IP</span>
    end

    <span class="hljs-comment"># Define the second web server (web02)</span>
    config.vm.define <span class="hljs-string">"web02"</span> <span class="hljs-keyword">do</span> |web02|
      web02.vm.box = <span class="hljs-string">"ubuntu/focal64"</span>            <span class="hljs-comment"># Ubuntu 20.04</span>
      web02.vm.hostname = <span class="hljs-string">"web02"</span>                <span class="hljs-comment"># Set hostname</span>
      web02.vm.network <span class="hljs-string">"private_network"</span>, ip: <span class="hljs-string">"192.168.56.42"</span>   <span class="hljs-comment"># Set private IP</span>
    end

    <span class="hljs-comment"># Define the database server (db01)</span>
    config.vm.define <span class="hljs-string">"db01"</span> <span class="hljs-keyword">do</span> |db01|
      db01.vm.box = <span class="hljs-string">"centos/7"</span>                   <span class="hljs-comment"># CentOS 7</span>
      db01.vm.hostname = <span class="hljs-string">"db01"</span>                  <span class="hljs-comment"># Set hostname</span>
      db01.vm.network <span class="hljs-string">"private_network"</span>, ip: <span class="hljs-string">"192.168.56.43"</span>    <span class="hljs-comment"># Set private IP</span>

      <span class="hljs-comment"># Provisioning for db01 to install MySQL</span>
      db01.vm.provision <span class="hljs-string">"shell"</span>, inline: &lt;&lt;-SHELL
        yum install -y wget unzip mariadb-server -y
        systemctl <span class="hljs-built_in">enable</span> mariadb
      SHELL
    end

end
</code></pre>
<h3 id="heading-explanation-of-the-vagrantfile">Explanation of the Vagrantfile</h3>
<ol>
<li><p><strong>VM Definitions</strong>:</p>
<ul>
<li>Each VM (<code>web01</code>, <code>web02</code>, <code>db01</code>) is defined separately to allow individual configuration.</li>
</ul>
</li>
<li><p><strong>Hostnames</strong>:</p>
<ul>
<li>Set each VM’s hostname using <code>vm.hostname</code>.</li>
</ul>
</li>
<li><p><strong>Private Network IPs</strong>:</p>
<ul>
<li>Each VM is assigned a unique private IP address, making them accessible within a private network only.</li>
</ul>
</li>
<li><p><strong>Provisioning for db01</strong>:</p>
<ul>
<li>Installs MariaDB (MySQL-compatible) on <code>db01</code> using a shell provisioner, then enables it to start on boot.</li>
</ul>
</li>
</ol>
<h3 id="heading-step-3-start-the-vagrant-environment">Step 3: Start the Vagrant Environment</h3>
<ol>
<li><p>Open a terminal and navigate to the <code>multivm</code> directory:</p>
<pre><code class="lang-bash"> <span class="hljs-built_in">cd</span> path/to/multivm
</code></pre>
</li>
<li><p>Start the Vagrant environment by running:</p>
<pre><code class="lang-bash"> vagrant up
</code></pre>
<p> This command creates and provisions the VMs based on the configuration in the <code>Vagrantfile</code>.</p>
</li>
</ol>
<h3 id="heading-step-4-ssh-into-the-vms">Step 4: SSH into the VMs</h3>
<p>After the setup is complete, you can SSH into any of the VMs to check their status, test configurations, and verify provisioning:</p>
<ul>
<li><p>To access <code>web01</code>:</p>
<pre><code class="lang-bash">  vagrant ssh web01
</code></pre>
</li>
<li><p>To access <code>web02</code>:</p>
<pre><code class="lang-bash">  vagrant ssh web02
</code></pre>
</li>
<li><p>To access <code>db01</code>:</p>
<pre><code class="lang-bash">  vagrant ssh db01
</code></pre>
</li>
</ul>
<hr />
<h2 id="heading-conclusion">Conclusion</h2>
<p>Setting up a multi-VM environment in Vagrant is a powerful way to simulate real-world infrastructure. With just a few configurations, you can create isolated, realistic development environments that mirror production setups. Whether you’re developing distributed applications, practicing for microservices, or setting up a testing environment, a multi-VM setup in Vagrant provides flexibility and reliability.</p>
]]></content:encoded></item><item><title><![CDATA[Why Learning Vagrant is Important for Aspiring DevOps and Platform Engineers]]></title><description><![CDATA[Learning Vagrant is essential for anyone looking to pursue a career as a DevOps or Platform Engineer. Vagrant enables environment automation, virtualization, and configuration management, providing foundational skills that are crucial for these roles...]]></description><link>https://zidans-blog.hashnode.dev/why-learning-vagrant-is-important-for-aspiring-devops-and-platform-engineers</link><guid isPermaLink="true">https://zidans-blog.hashnode.dev/why-learning-vagrant-is-important-for-aspiring-devops-and-platform-engineers</guid><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Zidan Niyas]]></dc:creator><pubDate>Thu, 14 Nov 2024 08:09:16 GMT</pubDate><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1731572053004/ba282b9a-e5f3-492e-86b4-65ce9659a6a5.jpeg" alt class="image--center mx-auto" /></p>
<p>Learning Vagrant is essential for anyone looking to pursue a career as a DevOps or Platform Engineer. Vagrant enables environment automation, virtualization, and configuration management, providing foundational skills that are crucial for these roles. Let’s explore why Vagrant is an important tool to master:</p>
<h2 id="heading-1-environment-consistency-and-infrastructure-as-code-iac">1. <strong>Environment Consistency and Infrastructure as Code (IaC)</strong></h2>
<p>Vagrant allows you to define and automate environment configurations through a single Vagrantfile. This ensures environment consistency, which is a core principle of Infrastructure as Code (IaC). With Vagrant, you can guarantee that every team member is working on the same environment, eliminating the common "it works on my machine" problem. This consistency is vital when working in teams or managing multiple environments.</p>
<h2 id="heading-2-efficient-testing-and-development-environments">2. <strong>Efficient Testing and Development Environments</strong></h2>
<p>Vagrant helps DevOps engineers rapidly create and test environments without waiting for physical or cloud resources. This is particularly useful for developing, testing, and deploying code across different environments that mimic production. With Vagrant, you can quickly spin up isolated environments, making it easy to test different configurations without worrying about impacting other systems.</p>
<h2 id="heading-3-proficiency-with-virtualization-and-provisioning">3. <strong>Proficiency with Virtualization and Provisioning</strong></h2>
<p>Vagrant integrates with various providers like VirtualBox, VMware, Docker, and even cloud services. This enables engineers to work with different platforms, understand their configurations, and optimize their performance. Additionally, Vagrant's provisioning tools—such as shell scripts, Ansible, or Puppet—allow you to automate the setup and configuration of environments. This builds essential skills in provisioning and automating system configurations, key tasks in both DevOps and Platform Engineering.</p>
<h2 id="heading-4-enhanced-collaboration-and-team-efficiency">4. <strong>Enhanced Collaboration and Team Efficiency</strong></h2>
<p>One of the biggest benefits of using Vagrant is its ability to create shareable, reproducible environments. Teams can easily share pre-configured Vagrant environments, reducing setup time and improving onboarding efficiency. By version-controlling the Vagrantfiles, teams ensure that all members are working on the same setup, leading to better collaboration and smoother development cycles.</p>
<h2 id="heading-5-simulating-complex-multi-vm-architectures">5. <strong>Simulating Complex, Multi-VM Architectures</strong></h2>
<p>Vagrant allows you to define multi-VM environments, which is especially useful for simulating production setups. For instance, you can create environments that include multiple web servers, database clusters, or load balancers. This enables platform engineers to understand how different services interact, test network configurations, and troubleshoot potential issues before deploying to real infrastructure.</p>
<h2 id="heading-6-foundation-for-containerization-and-cloud-environments">6. <strong>Foundation for Containerization and Cloud Environments</strong></h2>
<p>The core concepts of Vagrant—such as IaC, provisioning, and virtualization—apply directly to containerization and cloud environments. Starting with Vagrant helps you develop skills that will transfer to technologies like Docker, Kubernetes, and cloud platforms like AWS, GCP, or Azure. Understanding how to manage environments with Vagrant provides a solid foundation for learning more advanced concepts in containerization and cloud management.</p>
<h2 id="heading-7-troubleshooting-and-systems-thinking">7. <strong>Troubleshooting and Systems Thinking</strong></h2>
<p>Vagrant environments provide an excellent opportunity to practice troubleshooting skills. Working with Vagrant teaches you how to handle issues related to dependencies, network configurations, and system errors. For a DevOps engineer, having a holistic understanding of systems, their interactions, and how to resolve problems is crucial. The hands-on experience with Vagrant builds the troubleshooting mindset needed in real-world environments.</p>
<hr />
<p>In conclusion, Vagrant serves as a practical, hands-on tool for learning many core principles of DevOps and Platform Engineering. It provides an excellent introduction to critical concepts such as IaC, environment consistency, automation, and multi-VM configurations. By mastering Vagrant, aspiring engineers will be well-prepared to work with more advanced technologies like containerization and cloud infrastructure, making it an invaluable tool in your DevOps toolkit.</p>
]]></content:encoded></item><item><title><![CDATA[Week 2/12 : My First Dive into Infrastructure as Code: Automating Vagrant Setups]]></title><description><![CDATA[In this guide, we’ll walk through automating Vagrant provisioning to deploy a finance template webpage and a WordPress setup using infrastructure as code (IaC) on Ubuntu VMs. With Vagrant and automation scripts, we can set up these environments quick...]]></description><link>https://zidans-blog.hashnode.dev/week-212-my-first-dive-into-infrastructure-as-code-automating-vagrant-setups</link><guid isPermaLink="true">https://zidans-blog.hashnode.dev/week-212-my-first-dive-into-infrastructure-as-code-automating-vagrant-setups</guid><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Zidan Niyas]]></dc:creator><pubDate>Wed, 13 Nov 2024 14:44:43 GMT</pubDate><content:encoded><![CDATA[<p>In this guide, we’ll walk through automating Vagrant provisioning to deploy a finance template webpage and a WordPress setup using infrastructure as code (IaC) on Ubuntu VMs. With Vagrant and automation scripts, we can set up these environments quickly and efficiently.</p>
<hr />
<h2 id="heading-automating-finance-template-setup">Automating Finance Template Setup</h2>
<ol>
<li><p><strong>Step 1 : Open Project Folder</strong><br /> Open Visual Studio Code and navigate to your project folder where you keep your Vagrant files (eg: <code>vagrant-vms</code>).</p>
</li>
<li><p><strong>Step 2: Set Up Automated Provisioning for the Finance VM</strong></p>
<ol>
<li><p>Inside the <code>vagrant-vms</code> folder, locate the folder for your Finance VM.</p>
</li>
<li><p>Copy the entire <code>finance</code> folder (which includes the <code>Vagrantfile</code>) and rename the new folder to <code>financeIAC</code> to indicate this will be an Infrastructure as Code (IaC) setup.</p>
</li>
<li><p>In the <code>financeIAC</code> folder, open the <code>Vagrantfile</code> and locate the provisioning commands section. Update the commands as follows:</p>
<pre><code class="lang-bash"> yum install httpd wget unzip vim -y
 systemctl start httpd
 systemctl <span class="hljs-built_in">enable</span> httpd
 mkdir -p /tmp/finance
 <span class="hljs-built_in">cd</span> /tmp/finance
 wget https://www.tooplate.com/zip-templates/2135_mini_finance.zip
 unzip -o 2135_mini_finance.zip
 cp -r 2135_mini_finance/* /var/www/html/
 systemctl restart httpd
 <span class="hljs-built_in">cd</span> /tmp/
 rm -rf /tmp/finance
</code></pre>
</li>
</ol>
</li>
<li><p><strong>Start the VM with Provisioning</strong></p>
<ul>
<li><p>In the terminal, navigate to <code>financeIAC</code> and execute:</p>
<pre><code class="lang-bash">  vagrant up
</code></pre>
</li>
<li><p>This will run the provisioning script automatically while powering on the VM.</p>
</li>
</ul>
</li>
<li><p><strong>Access the Finance Template Webpage</strong></p>
<ul>
<li><p>SSH into the VM:</p>
<pre><code class="lang-bash">  vagrant ssh
</code></pre>
</li>
<li><p>Get the IP address by running:</p>
<pre><code class="lang-bash">  ip addr show
</code></pre>
</li>
<li><p>Copy the IP address and paste it into your browser to view the finance template webpage.</p>
</li>
</ul>
</li>
</ol>
<hr />
<h2 id="heading-automating-wordpress-setup">Automating WordPress Setup</h2>
<ol>
<li><p><strong>Duplicate the WordPress VM Folder (assuming it has already been created)</strong></p>
<ul>
<li>Copy the <code>wordpress</code> folder in <code>vagrant-vms</code> and rename it to <code>wordpressIAC</code>.</li>
</ul>
</li>
<li><p><strong>Update the Vagrantfile for Automatic WordPress Provisioning</strong></p>
<ul>
<li><p>Open the <code>Vagrantfile</code> in the <code>wordpressIAC</code> folder and add the following commands in the <code>config.vm.provision</code> section:</p>
<pre><code class="lang-bash">  <span class="hljs-comment"># Install dependencies</span>
  sudo apt update
  sudo apt install apache2 \
                   ghostscript \
                   libapache2-mod-php \
                   mysql-server \
                   php \
                   php-bcmath \
                   php-curl \
                   php-imagick \
                   php-intl \
                   php-json \
                   php-mbstring \
                   php-mysql \
                   php-xml \
                   php-zip -y
  <span class="hljs-comment"># Install WordPress</span>
  sudo mkdir -p /srv/www
  sudo chown www-data: /srv/www
  curl https://wordpress.org/latest.tar.gz | sudo -u www-data tar zx -C /srv/www

  <span class="hljs-comment"># Configure Apache for WordPress</span>
  cat &gt; /etc/apache2/sites-available/wordpress.conf &lt;&lt;EOF
  &lt;VirtualHost *:80&gt;
      DocumentRoot /srv/www/wordpress
      &lt;Directory /srv/www/wordpress&gt;
          Options FollowSymLinks
          AllowOverride Limit Options FileInfo
          DirectoryIndex index.php
          Require all granted
      &lt;/Directory&gt;
      &lt;Directory /srv/www/wordpress/wp-content&gt;
          Options FollowSymLinks
          Require all granted
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  EOF

  sudo a2ensite wordpress
  sudo a2enmod rewrite
  sudo a2dissite 000-default
  sudo service apache2 reload

  <span class="hljs-comment"># Configure Database</span>
  mysql -u root <span class="hljs-string">'CREATE DATABASE wordpress;'</span>
  mysql -u root <span class="hljs-string">'CREATE USER wordpress@localhost IDENTIFIED BY "admin123";'</span>
  mysql -u root <span class="hljs-string">'GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON wordpress.* TO wordpress@localhost;'</span>
  mysql -u root <span class="hljs-string">'FLUSH PRIVILEGES;'</span>

  <span class="hljs-comment"># Connect WordPress to the Database</span>
  sudo -u www-data cp /srv/www/wordpress/wp-config-sample.php /srv/www/wordpress/wp-config.php
  sudo -u www-data sed -i <span class="hljs-string">'s/database_name_here/wordpress/'</span> /srv/www/wordpress/wp-config.php
  sudo -u www-data sed -i <span class="hljs-string">'s/username_here/wordpress/'</span> /srv/www/wordpress/wp-config.php
  sudo -u www-data sed -i <span class="hljs-string">'s/password_here/admin123/'</span> /srv/www/wordpress/wp-config.php

  systemctl restart mysql
  systemctl restart apache2
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Start the WordPress VM with Provisioning</strong></p>
<ul>
<li><p>In the terminal, navigate to the <code>wordpressIAC</code> folder and run:</p>
<pre><code class="lang-bash">  vagrant up
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Access the WordPress Site</strong></p>
<ul>
<li><p>SSH into the VM:</p>
<pre><code class="lang-bash">  vagrant ssh
</code></pre>
</li>
<li><p>Get the IP address:</p>
<pre><code class="lang-bash">  ip addr show
</code></pre>
</li>
<li><p>Copy the IP address and paste it into your browser to access the WordPress site.</p>
</li>
</ul>
</li>
</ol>
<hr />
<p>Using automated provisioning with Vagrant simplifies the process of setting up and deploying environments. This guide helps you configure both a finance webpage and WordPress with minimal manual intervention—perfect for infrastructure as code setups!</p>
]]></content:encoded></item><item><title><![CDATA[Week 2/12 : Install and Configure WordPress on an Ubuntu Virtual Machine]]></title><description><![CDATA[WordPress is the most popular open-source blogging system and CMS on the web. It's built on PHP and MySQL, making it a powerful tool for content management. Follow these steps to set up a WordPress blog on an Ubuntu VM.

VM Setup

Create a Working Di...]]></description><link>https://zidans-blog.hashnode.dev/week-212-install-and-configure-wordpress-on-an-ubuntu-virtual-machine</link><guid isPermaLink="true">https://zidans-blog.hashnode.dev/week-212-install-and-configure-wordpress-on-an-ubuntu-virtual-machine</guid><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Zidan Niyas]]></dc:creator><pubDate>Wed, 13 Nov 2024 13:37:34 GMT</pubDate><content:encoded><![CDATA[<p>WordPress is the most popular open-source blogging system and CMS on the web. It's built on PHP and MySQL, making it a powerful tool for content management. Follow these steps to set up a WordPress blog on an Ubuntu VM.</p>
<hr />
<h2 id="heading-vm-setup">VM Setup</h2>
<ol>
<li><p><strong>Create a Working Directory</strong></p>
<pre><code class="lang-bash"> mkdir wordpress &amp;&amp; <span class="hljs-built_in">cd</span> wordpress
</code></pre>
</li>
<li><p><strong>Set Up the Ubuntu Box</strong></p>
<ul>
<li><p>Go to Vagrant Cloud and find the Ubuntu 20.04 box (commonly named <code>ubuntu/focal64</code>).</p>
</li>
<li><p>Copy the address and use it to initialize your Vagrant setup:</p>
<pre><code class="lang-bash">  vagrant init &lt;box-address&gt;
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Edit the Vagrant Configuration</strong></p>
<ul>
<li><p>Open the <code>Vagrantfile</code> and uncomment the lines for private and public network configurations.</p>
</li>
<li><p>Set the VM memory size to <code>1600 MB</code>:</p>
<pre><code class="lang-bash">  vim Vagrantfile
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Launch and SSH into the VM</strong></p>
<pre><code class="lang-bash"> vagrant up
 vagrant ssh
</code></pre>
</li>
<li><p><strong>Change the Hostname</strong></p>
<ul>
<li><p>Switch to the root user:</p>
<pre><code class="lang-bash">  sudo -i
</code></pre>
</li>
<li><p>Edit the hostname file:</p>
<pre><code class="lang-bash">  vim /etc/hostname
</code></pre>
</li>
<li><p>Change the hostname to <code>wordpress</code> and set it immediately:</p>
<pre><code class="lang-bash">  hostname wordpress
</code></pre>
</li>
<li><p>Log out and log back in to apply changes.</p>
</li>
</ul>
</li>
</ol>
<hr />
<h2 id="heading-wordpress-installation-and-configuration">WordPress Installation and Configuration</h2>
<p>Follow the official <a target="_blank" href="https://ubuntu.com/tutorials/install-and-configure-wordpress">Ubuntu WordPress installation guide</a>.</p>
<h3 id="heading-1-install-dependencies">1. Install Dependencies</h3>
<p>Update packages and install the necessary dependencies:</p>
<pre><code class="lang-bash">sudo apt update
sudo apt install apache2 \
                 ghostscript \
                 libapache2-mod-php \
                 mysql-server \
                 php \
                 php-bcmath \
                 php-curl \
                 php-imagick \
                 php-intl \
                 php-json \
                 php-mbstring \
                 php-mysql \
                 php-xml \
                 php-zip -y
</code></pre>
<h3 id="heading-2-download-and-set-up-wordpress">2. Download and Set Up WordPress</h3>
<pre><code class="lang-bash">sudo mkdir -p /srv/www
sudo chown www-data: /srv/www
curl https://wordpress.org/latest.tar.gz | sudo -u www-data tar zx -C /srv/www
</code></pre>
<h3 id="heading-3-configure-apache-for-wordpress">3. Configure Apache for WordPress</h3>
<ul>
<li><p>Create and open a new configuration file for WordPress:</p>
<pre><code class="lang-bash">  sudo vim /etc/apache2/sites-available/wordpress.conf
</code></pre>
</li>
<li><p>Add the following content:</p>
<pre><code class="lang-bash">  &lt;VirtualHost *:80&gt;
      DocumentRoot /srv/www/wordpress
      &lt;Directory /srv/www/wordpress&gt;
          Options FollowSymLinks
          AllowOverride Limit Options FileInfo
          DirectoryIndex index.php
          Require all granted
      &lt;/Directory&gt;
      &lt;Directory /srv/www/wordpress/wp-content&gt;
          Options FollowSymLinks
          Require all granted
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
</code></pre>
</li>
<li><p>Enable the site and necessary modules:</p>
<pre><code class="lang-bash">  sudo a2ensite wordpress
  sudo a2enmod rewrite
  sudo a2dissite 000-default
  sudo service apache2 reload
</code></pre>
</li>
</ul>
<h3 id="heading-4-configure-mysql-database-for-wordpress">4. Configure MySQL Database for WordPress</h3>
<ul>
<li><p>Log into MySQL as root:</p>
<pre><code class="lang-bash">  sudo mysql -u root
</code></pre>
</li>
<li><p>Run the following SQL commands to create a database and user:</p>
<pre><code class="lang-bash">  CREATE DATABASE wordpress;
  CREATE USER wordpress@localhost IDENTIFIED BY <span class="hljs-string">'&lt;your-password&gt;'</span>;
  GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON wordpress.* TO wordpress@localhost;
  FLUSH PRIVILEGES;
  quit
</code></pre>
</li>
</ul>
<h3 id="heading-5-connect-wordpress-to-the-database">5. Connect WordPress to the Database</h3>
<ul>
<li><p>Copy the sample configuration file:</p>
<pre><code class="lang-bash">  sudo -u www-data cp /srv/www/wordpress/wp-config-sample.php /srv/www/wordpress/wp-config.php
</code></pre>
</li>
<li><p>Replace the database details:</p>
<pre><code class="lang-bash">  bashCopy codesudo -u www-data sed -i <span class="hljs-string">'s/database_name_here/wordpress/'</span> /srv/www/wordpress/wp-config.php
  sudo -u www-data sed -i <span class="hljs-string">'s/username_here/wordpress/'</span> /srv/www/wordpress/wp-config.php
  sudo -u www-data sed -i <span class="hljs-string">'s/password_here/&lt;your-password&gt;/'</span> /srv/www/wordpress/wp-config.php
</code></pre>
</li>
<li><p>Open the configuration file and set the security keys:</p>
<pre><code class="lang-bash">  sudo -u www-data vim /srv/www/wordpress/wp-config.php
</code></pre>
</li>
<li><p>Replace the placeholders with these keys: (given in the ubuntu wordpress installation page)</p>
<pre><code class="lang-bash">  phpCopy codedefine(<span class="hljs-string">'AUTH_KEY'</span>,         <span class="hljs-string">'(QG~pri#N)*M3Q%0SWu,q*57?jdB%cMspH+ ]&amp;5g6-/HB%C9WQ/r1}Iy/n&amp;` a{{'</span>);
  define(<span class="hljs-string">'SECURE_AUTH_KEY'</span>,  <span class="hljs-string">'AuCWh,@b3.=7&gt;H3+)jnre23O@bFc14Y 5fc4mUZR/{?lJ-+5|f6]=W_^&amp;QlKi|:U'</span>);
  define(<span class="hljs-string">'LOGGED_IN_KEY'</span>,    <span class="hljs-string">'/P(H,-u~pP%O-kUf:@P}Za-a%&lt;iKt])(US%QW`zt@2[P8*]7|zAyf,(z&amp;fL`m,vs'</span>);
  define(<span class="hljs-string">'NONCE_KEY'</span>,        <span class="hljs-string">'6.&lt;@,E1B.4,/;-q~{qoE#E]X6Y[dywT`+&gt;/3@B~xKAoAiL=-1l&lt;;P-p&lt;+nHCK(|_'</span>);
  define(<span class="hljs-string">'AUTH_SALT'</span>,        <span class="hljs-string">'6aS2D`%4++wk|lc9s3NOX`1 {p~aDG6km(wBM|Q,(%(+.bGR7GBAPX6Tm-E)y#ZJ'</span>);
  define(<span class="hljs-string">'SECURE_AUTH_SALT'</span>, <span class="hljs-string">'a!24(@}Qusa0H|_}W~DRp8_b&lt;|GFUrV.`B8$MG0vHi+?yUT&gt;^bR1}Vs?%ul&gt;U,-L'</span>);
  define(<span class="hljs-string">'LOGGED_IN_SALT'</span>,   <span class="hljs-string">'W*hJ.X7A2mj4-I]U%KnEtLlsdW0wCe2g(;G!9H/#cef&lt;V+;pOc%loziWY)d0tH)?'</span>);
  define(<span class="hljs-string">'NONCE_SALT'</span>,       <span class="hljs-string">'b&gt;0/{Skj;C-: fyf_&lt;:x= aYggd&lt;N)O9u1&gt;/3@WhdKwBA7o&gt;l+l_;yc6](5R!qN?'</span>);
</code></pre>
</li>
</ul>
<h3 id="heading-6-access-wordpress-in-the-browser">6. Access WordPress in the Browser</h3>
<ul>
<li><p>Run the following command to get your VM’s IP address:</p>
<pre><code class="lang-bash">  ip addr show
</code></pre>
</li>
<li><p>Copy the IP address (e.g., <code>192.168.56.26</code>) and paste it into your browser’s address bar to access the WordPress setup page.</p>
</li>
</ul>
<hr />
<p>Your WordPress blog should now be set up and accessible from the browser.</p>
]]></content:encoded></item><item><title><![CDATA[Week 2/12 : Creating and Hosting a Webpage on a Linux Server Using Vagrant and CentOS]]></title><description><![CDATA[Hosting a webpage on a Linux server can be a simple and rewarding project. In this guide, we’ll cover setting up a virtual machine (VM) with CentOS, installing HTTPD on CentOS, and finally uploading a custom webpage template to the server.
1. Setting...]]></description><link>https://zidans-blog.hashnode.dev/week-212-creating-and-hosting-a-webpage-on-a-linux-server-using-vagrant-and-centos</link><guid isPermaLink="true">https://zidans-blog.hashnode.dev/week-212-creating-and-hosting-a-webpage-on-a-linux-server-using-vagrant-and-centos</guid><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Zidan Niyas]]></dc:creator><pubDate>Tue, 12 Nov 2024 11:53:49 GMT</pubDate><content:encoded><![CDATA[<p>Hosting a webpage on a Linux server can be a simple and rewarding project. In this guide, we’ll cover setting up a virtual machine (VM) with CentOS, installing HTTPD on CentOS, and finally uploading a custom webpage template to the server.</p>
<h2 id="heading-1-setting-up-a-virtual-machine-with-vagrant">1. Setting up a Virtual Machine with Vagrant</h2>
<p>First, we’ll create a new VM using Vagrant and configure it for our server.</p>
<pre><code class="lang-bash">mkdir finance
<span class="hljs-built_in">cd</span> finance
vagrant box list
</code></pre>
<p>Use <code>vagrant box list</code> to see which boxes you have installed. For CentOS, we’ll use the box "eurolinux centos stream 9".</p>
<pre><code class="lang-bash">vagrant init &lt;box-name&gt;
vagrant up
vagrant ssh
</code></pre>
<p>Now that we’re connected, let’s set up our web server.</p>
<hr />
<h2 id="heading-2-installing-httpd-on-centos">2. Installing HTTPD on CentOS</h2>
<p>To configure an HTTP server on CentOS, we’ll use HTTPD.</p>
<h3 id="heading-step-1-install-httpd-and-other-tools">Step 1: Install HTTPD and Other Tools</h3>
<pre><code class="lang-bash">yum install httpd wget vim unzip zip -y
</code></pre>
<h3 id="heading-step-2-start-and-enable-httpd">Step 2: Start and Enable HTTPD</h3>
<pre><code class="lang-bash">systemctl start httpd
systemctl <span class="hljs-built_in">enable</span> httpd
</code></pre>
<p>Enabling HTTPD ensures that the service restarts even after a VM reboot.</p>
<h3 id="heading-step-3-find-your-ip-address">Step 3: Find Your IP Address</h3>
<p>Retrieve the IP address of the server by running:</p>
<pre><code class="lang-bash">ip addr show
</code></pre>
<p>Copy the IP address (e.g., <code>192.168.56.22</code>) and paste it in your browser to view the default HTTPD webpage.</p>
<h3 id="heading-step-4-customize-the-default-webpage">Step 4: Customize the Default Webpage</h3>
<p>Navigate to the HTML directory and edit <code>index.html</code>:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> /var/www/html/
vim index.html
</code></pre>
<p>After saving your changes, restart HTTPD:</p>
<pre><code class="lang-bash">systemctl restart httpd
</code></pre>
<p>Refresh your browser with the server IP to see the changes you made to <code>index.html</code>.</p>
<hr />
<h2 id="heading-3-uploading-a-website-template-to-the-http-server">3. Uploading a Website Template to the HTTP Server</h2>
<p>Now, let’s add a custom webpage template to the server.</p>
<h3 id="heading-step-1-download-a-website-template">Step 1: Download a Website Template</h3>
<ol>
<li><p>Visit <a target="_blank" href="https://www.tooplate.com">tooplate.com</a> and choose a template.</p>
</li>
<li><p>Open Developer Tools in your browser and go to the <strong>Network</strong> tab.</p>
</li>
<li><p>Download the template and find the zip file in the <strong>Network</strong> tab.</p>
</li>
<li><p>Copy the download link for the zip file.</p>
</li>
</ol>
<h3 id="heading-step-2-download-and-extract-the-template-on-the-server">Step 2: Download and Extract the Template on the Server</h3>
<p>Go to the <code>/tmp</code> directory in your terminal:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> /tmp
wget &lt;download-link-for-the-zip&gt;
ls
</code></pre>
<p>Unzip the downloaded template:</p>
<pre><code class="lang-bash">unzip &lt;zip-file-name&gt;
<span class="hljs-built_in">cd</span> &lt;unzipped-folder-name&gt;
ls
</code></pre>
<p>You’ll see folders like <code>index.html</code>, <code>js</code>, and <code>css</code>.</p>
<h3 id="heading-step-3-copy-template-files-to-the-web-directory">Step 3: Copy Template Files to the Web Directory</h3>
<p>Copy the template files to the HTTP server’s HTML directory:</p>
<pre><code class="lang-bash">cp -r * /var/www/html/
systemctl restart httpd
</code></pre>
<p>Now, refresh the webpage in your browser with the server IP (e.g., <code>192.168.56.22</code>), and you’ll see the custom template displayed!</p>
]]></content:encoded></item><item><title><![CDATA[Week 1/12 : Introduction to Linux Basics and Virtualization with Vagrant]]></title><description><![CDATA[Starting a journey into DevOps can be overwhelming with all the tools and concepts out there. This week, I decided to begin with two foundational elements: Linux basics and virtualization using Vagrant. Both are essential for DevOps, where we often w...]]></description><link>https://zidans-blog.hashnode.dev/day-1-starting-my-devops-journey</link><guid isPermaLink="true">https://zidans-blog.hashnode.dev/day-1-starting-my-devops-journey</guid><category><![CDATA[DevOps Journey]]></category><dc:creator><![CDATA[Zidan Niyas]]></dc:creator><pubDate>Sat, 09 Nov 2024 15:24:57 GMT</pubDate><content:encoded><![CDATA[<p>Starting a journey into DevOps can be overwhelming with all the tools and concepts out there. This week, I decided to begin with two foundational elements: Linux basics and virtualization using Vagrant. Both are essential for DevOps, where we often work with cloud servers, virtualized environments, and infrastructure automation. In this post, I’ll break down what I learned about Linux and how Vagrant makes it easy to create virtualized environments to test and deploy applications consistently.</p>
<h2 id="heading-what-is-vagrant-and-why-use-it">What is Vagrant and Why Use It?</h2>
<p>Vagrant is a powerful tool that allows you to create and manage lightweight, reproducible, and portable virtual environments. Think of it as a way to quickly set up a virtual machine (VM) without the hassle of manually configuring everything each time. Here’s why Vagrant is particularly useful in DevOps:</p>
<ul>
<li><p><strong>Environment Consistency</strong>: Vagrant lets you define the environment setup in a single file (Vagrantfile), so every team member or project can have the same configuration.</p>
</li>
<li><p><strong>Quick Setup and Teardown</strong>: You can start, pause, and destroy VMs with a single command, making it easy to spin up new environments for testing or sandboxing.</p>
</li>
<li><p><strong>Portability and Version Control</strong>: Vagrant’s configurations are code-based, meaning you can version control your environment just like you do with code.</p>
</li>
</ul>
<p>I used Vagrant in this past week to set up VMs on my local machine and experiment with Linux commands in an isolated environment. This process helped me avoid any impact on my main OS while practicing.</p>
<hr />
<h2 id="heading-basic-linux-commands">Basic Linux Commands</h2>
<p>Since Linux is the backbone of most server environments, knowing your way around the Linux command line is crucial in DevOps. Here are a few commands I learned this week and their purposes:</p>
<ol>
<li><p><strong>File and Directory Management</strong></p>
<ul>
<li><p><code>ls</code> - List files and directories.</p>
</li>
<li><p><code>cd</code> - Change directory.</p>
</li>
<li><p><code>mkdir</code> - Create a new directory.</p>
</li>
<li><p><code>rm</code> - Remove files (use with caution!).</p>
</li>
<li><p><code>cp</code> - Copy files from one location to another.</p>
</li>
</ul>
</li>
<li><p><strong>File Permissions</strong></p>
<ul>
<li><p><code>chmod</code> - Change file permissions.</p>
</li>
<li><p><code>chown</code> - Change file ownership.</p>
</li>
</ul>
</li>
<li><p><strong>Text Editing</strong></p>
<ul>
<li><code>nano</code> or <code>vim</code> - Edit files directly from the terminal.</li>
</ul>
</li>
<li><p><strong>System Information</strong></p>
<ul>
<li><p><code>top</code> - View running processes and system usage.</p>
</li>
<li><p><code>df -h</code> - Check disk space usage.</p>
</li>
<li><p><code>uname -a</code> - Display system information.</p>
</li>
</ul>
</li>
</ol>
<p>Using these commands within the VM set up by Vagrant gave me a safe space to explore without worrying about affecting my main OS.</p>
<hr />
<h2 id="heading-setting-up-virtual-machines-vms-using-vagrant">Setting Up Virtual Machines (VMs) Using Vagrant</h2>
<p>Setting up a virtual machine with Vagrant is straightforward. Vagrant uses a <code>Vagrantfile</code> to define the VM configuration, so you only need to create this file once. Here’s a step-by-step of how I set up my first VM with Vagrant:</p>
<ol>
<li><p><strong>Installing Vagrant and VirtualBox</strong></p>
<ul>
<li><p>Vagrant uses providers to run VMs. I chose VirtualBox, which is free and works well with Vagrant.</p>
</li>
<li><p>After installing both Vagrant and VirtualBox, I was ready to create a virtualized environment.</p>
</li>
</ul>
</li>
<li><p><strong>Creating the Vagrantfile</strong></p>
<ul>
<li>I navigated to my project directory and ran <code>vagrant init</code> to generate a basic <code>Vagrantfile</code>.</li>
</ul>
</li>
<li><p><strong>Starting the VM</strong></p>
<ul>
<li><p>With the <code>Vagrantfile</code> ready, I used <code>vagrant up</code> to start the VM. Vagrant took care of downloading and configuring the VM, allowing me to SSH into it with <code>vagrant ssh</code>.</p>
</li>
<li><p>Once inside, I could run all the Linux commands I learned in an isolated environment, free to experiment.</p>
</li>
</ul>
</li>
<li><p><strong>Pausing and Destroying the VM</strong></p>
<ul>
<li>Vagrant makes it easy to stop (<code>vagrant halt</code>) or delete (<code>vagrant destroy</code>) VMs when they’re no longer needed, freeing up system resources.</li>
</ul>
</li>
</ol>
<hr />
<h2 id="heading-working-inside-vagrant-vms">Working Inside Vagrant VMs</h2>
<p>Once inside my Vagrant VM, I was able to apply the Linux commands I learned without impacting my host machine. Here’s how I made the most of this environment:</p>
<ul>
<li><p>Practicing commands like <code>mkdir</code>, <code>ls</code>, and <code>rm</code> to create and remove directories.</p>
</li>
<li><p>Using <code>nano</code> to create text files and practice editing.</p>
</li>
<li><p>Setting up a simple directory structure and applying different permission levels with <code>chmod</code>.</p>
</li>
<li><p>Testing and troubleshooting commands without worrying about affecting my system outside the VM.</p>
</li>
</ul>
<p>The Vagrant environment acted as a safe playground, letting me get comfortable with Linux without risk.</p>
<hr />
<h2 id="heading-key-takeaways">Key Takeaways</h2>
<p>This week was full of new concepts, and here are the main things I learned:</p>
<ul>
<li><p><strong>Linux commands</strong> are the building blocks of server management and automation, and getting comfortable with them is crucial.</p>
</li>
<li><p><strong>Vagrant simplifies the setup of virtualized environments</strong>, allowing for consistent development environments and easy testing.</p>
</li>
<li><p>The ability to <strong>start, pause, and destroy VMs with a few commands</strong> makes Vagrant a great choice for DevOps.</p>
</li>
</ul>
<hr />
<h2 id="heading-conclusion">Conclusion</h2>
<p>This week’s introduction to Linux and Vagrant has laid a strong foundation for my DevOps journey. Learning to create and work in isolated Vagrant VMs gave me a safe space to practice Linux basics, and I can already see how these skills will help me in more advanced projects.</p>
]]></content:encoded></item></channel></rss>