<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lawal Tobiloba</title>
    <description>The latest articles on DEV Community by Lawal Tobiloba (@tobilol).</description>
    <link>https://dev.to/tobilol</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1273559%2F2538d045-b85d-4969-ae3e-adde568f93b5.png</url>
      <title>DEV Community: Lawal Tobiloba</title>
      <link>https://dev.to/tobilol</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tobilol"/>
    <language>en</language>
    <item>
      <title>HNG Internship: DevOps Stage 0 - NGINX Configuration and Optimization for High-Performance Web Servers</title>
      <dc:creator>Lawal Tobiloba</dc:creator>
      <pubDate>Thu, 06 Feb 2025 09:05:22 +0000</pubDate>
      <link>https://dev.to/tobilol/hng-internship-devops-stage-0-nginx-configuration-and-optimization-for-high-performance-web-2h6j</link>
      <guid>https://dev.to/tobilol/hng-internship-devops-stage-0-nginx-configuration-and-optimization-for-high-performance-web-2h6j</guid>
      <description>&lt;p&gt;Web server configuration is a fundamental aspect of DevOps engineering. This article presents a case study of NGINX deployment on a freshly provisioned Ubuntu server on Amazon Web Services, as undertaken for the HNG DevOps Stage 0 challenge. The subsequent section details the methodology employed and highlights the key takeaways from this technical exercise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technical Requirements
&lt;/h2&gt;

&lt;p&gt;To successfully set up and configure NGINX on a fresh Ubuntu server hosted on AWS, ensure you have the following tools:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. AWS Account:&lt;/strong&gt; To provision and manage EC2 instances.&lt;br&gt;
&lt;strong&gt;2. SSH Client:&lt;/strong&gt; For secure remote access to your Ubuntu server.&lt;br&gt;
&lt;strong&gt;3. Ubuntu Server on AWS EC2:&lt;/strong&gt; The virtual machine where NGINX will be installed.&lt;br&gt;
&lt;strong&gt;4. NGINX:&lt;/strong&gt; The web server software to be installed.&lt;br&gt;
&lt;strong&gt;5. Text Editor:&lt;/strong&gt;For editing configuration files and creating custom HTML pages.&lt;br&gt;
&lt;strong&gt;6. Web Browser:&lt;/strong&gt;To test and verify the web server's functionality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Setting Up an Ubuntu Server on AWS&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log in to the &lt;a href="https://aws.amazon.com/console/" rel="noopener noreferrer"&gt;AWS Management Console&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Navigate to EC2 and create a new instance.&lt;/li&gt;
&lt;li&gt;Select Ubuntu 22.04 LTS as the operating system.&lt;/li&gt;
&lt;li&gt;Chose an instance type (free-tier eligibility works fine).&lt;/li&gt;
&lt;li&gt;Configure security groups to allow:

&lt;ul&gt;
&lt;li&gt;SSH access (port 22)&lt;/li&gt;
&lt;li&gt;HTTP traffic (port 80)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Downloaded the private key (.pem) file to securely connect to the instance.
&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -i /path/to/key.pem ubuntu@your-server-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Install NGINX&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once connection to the server is Establish, proceed with installing NGINX:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
sudo apt install nginx -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;After installation, start and enable NGINX:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start nginx
sudo systemctl enable nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;To verify that NGINX is running, use:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Open a browser and navigate to &lt;em&gt;&lt;a href="http://your-server-ip" rel="noopener noreferrer"&gt;http://your-server-ip&lt;/a&gt;&lt;/em&gt; 
this displays the default NGINX welcome page, confirming a successful installation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Configuring NGINX to Serve a Custom Page&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To personalize the default page, edit the index.html file:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /var/www/html/index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;replace the existing content with the following HTML code:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
   &amp;lt;title&amp;gt;Welcome&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
   &amp;lt;h1&amp;gt;Welcome to DevOps Stage 0 - [Your Name]/[Your Slack Name]&amp;lt;/h1&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;After saving the file then restart the NGINX service to apply the changes:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Finally, verify that the custom welcome message is displayed by visiting &lt;a href="http://your-server-ip" rel="noopener noreferrer"&gt;http://your-server-ip&lt;/a&gt; in a web browser.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Takeaways&lt;/strong&gt; &lt;br&gt;
Here are the top things to take away from this project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Provisioning an AWS EC2 instance: how to create a virtual server on Amazon Web Services (AWS) using EC2. This is a fundamental skill for anyone working in cloud computing.&lt;/li&gt;
&lt;li&gt;Linux command-line operations: The use of Linux commands to navigate, install software, and configure the server. This is an essential skill for any developer or system administrator.&lt;/li&gt;
&lt;li&gt;Installing and configuring a web server: how to install and set up a web server using NGINX. This involved configuring files, restarting the server, and testing everything to making sure it works.&lt;/li&gt;
&lt;li&gt;Troubleshooting common server issues: As I worked on this project, I encountered some errors and issues. I learned how to troubleshoot these problems using online resources, documentation, and good old-fashioned debugging techniques.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These skills are crucial for anyone working in DevOps, cloud computing, or web development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Professional Service&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://hng.tech/hire/cloud-engineers" rel="noopener noreferrer"&gt;Cloud Engineers&lt;/a&gt;&lt;br&gt;
&lt;a href="https://hng.tech/hire/platform-engineers" rel="noopener noreferrer"&gt;Platform Engineers&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>cloudengineers</category>
      <category>platformengineer</category>
      <category>hng</category>
    </item>
  </channel>
</rss>
