<?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: Success John</title>
    <description>The latest articles on DEV Community by Success John (@success_john_7a76d623a3b2).</description>
    <link>https://dev.to/success_john_7a76d623a3b2</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%2F2802586%2Fca9ef402-4eae-42f7-b5bc-017573e8715f.png</url>
      <title>DEV Community: Success John</title>
      <link>https://dev.to/success_john_7a76d623a3b2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/success_john_7a76d623a3b2"/>
    <language>en</language>
    <item>
      <title>Configuring Nginx On Amazon EC2</title>
      <dc:creator>Success John</dc:creator>
      <pubDate>Sat, 01 Feb 2025 20:36:06 +0000</pubDate>
      <link>https://dev.to/success_john_7a76d623a3b2/configuring-nginx-on-amazon-ec2-3dp0</link>
      <guid>https://dev.to/success_john_7a76d623a3b2/configuring-nginx-on-amazon-ec2-3dp0</guid>
      <description>&lt;p&gt;Hi!. &lt;br&gt;
In today's article, I will be walking through the steps to install and configure Nginx on Amazon EC2 using the Ubuntu Server. This is the first task of my HNG DevOps Internship and I am to serve a custom HTML page that shows my name and Slack username. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up Ubuntu On Amazon EC2&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first step is to create an EC2 instance using the Ubuntu AMI.&lt;/li&gt;
&lt;li&gt;Instance Type: An instance type specifies the hardware to be used for the instance. I used the t2 micro instance type since it is free tier eligible. &lt;/li&gt;
&lt;li&gt;Security Group: A security group is a set of firewall rules that control the traffic for my instance. &lt;/li&gt;
&lt;li&gt;Key Pair: To securely connect to my instance. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After creating The EC2 Instance and it is up and running, I am able connect to the EC2 Instance and start the Nginx installation process. &lt;/p&gt;

&lt;p&gt;To install Nginx, I used these commands:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;After enabling nginx, I added my name and Slack username to the HTML file using the vi editor.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;After saving the HTML file, I had to reboot Nginx so that I could get the new changes with these commands:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;To verify that the custom HTML Page has been rendered on my browser, I navigated to the IPv4 address generated by AWS for the instance in my web browser.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Challenges&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I was opening the IP address link directly from AWS and by default it was an HTTPS address and I kept having the "CONNECTION_REFUSED" error on my browser. I later discovered that Nginx default config is HTTP only and i had to force my browser to use HTTP. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How this task contributes to my learning and professional goals.&lt;/strong&gt;&lt;br&gt;
 Working on this task has helped me enhance my troubleshooting skills. in a bid to understand the issue with the connection refused error on my browser, I was able to learn more about networking. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://hng.tech/hire/devops-engineers" rel="noopener noreferrer"&gt;Devops Engineers&lt;/a&gt;&lt;br&gt;
&lt;a href="https://hng.tech/hire/cloud-engineers" rel="noopener noreferrer"&gt;Cloud Engineers&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
