<?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: akpomuetata fejiro</title>
    <description>The latest articles on DEV Community by akpomuetata fejiro (@feji).</description>
    <link>https://dev.to/feji</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2794207%2F91e4a959-e791-4267-aa2b-e8181e32b5ef.jpg</url>
      <title>DEV Community: akpomuetata fejiro</title>
      <link>https://dev.to/feji</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/feji"/>
    <language>en</language>
    <item>
      <title>HNG DEVOPS STAGE 0: Configuring Nginx on an ubuntu server</title>
      <dc:creator>akpomuetata fejiro</dc:creator>
      <pubDate>Thu, 30 Jan 2025 23:52:36 +0000</pubDate>
      <link>https://dev.to/feji/hng-devops-stage-0-configuring-nginx-on-an-ubuntu-server-2aob</link>
      <guid>https://dev.to/feji/hng-devops-stage-0-configuring-nginx-on-an-ubuntu-server-2aob</guid>
      <description>&lt;p&gt;&lt;strong&gt;INTRODUCTION&lt;/strong&gt;&lt;br&gt;
Our first task as being part of the HNG DevOps internship program was configuring Nginx on an ubuntu server and also customizing the HTML page. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon linux 2, t2.micro instance&lt;/li&gt;
&lt;li&gt;port 22 (to enable ssh)&lt;/li&gt;
&lt;li&gt;port 80 (to enable access from anywhere)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;steps&lt;br&gt;
&lt;strong&gt;connecting to the instance&lt;/strong&gt;&lt;br&gt;
After setting up my instance with the appropriate keypair and security group, i launched the instanced and waited for it to run. thereafter i connected to the instance via the Ec2 instance connect.&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%2Fnvxiooo5t8y4n262b3oi.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%2Fnvxiooo5t8y4n262b3oi.png" alt="Image description" width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing Nginx and starting it&lt;/strong&gt;&lt;br&gt;
the following commands are used in installing nginx on amazon linux 2&lt;br&gt;
sudo yum update - to update any needed packages&lt;br&gt;
sudo amazon-linux-extras install nginx1 - to install nginx&lt;br&gt;
sudo systemctl start nginx - to start nginx&lt;br&gt;
sudo systemctl enable nginx - to enable nginx&lt;br&gt;
sudo systemctl status nginx - to verify that nginx is runing&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%2Fljx2gccbslimmtqcsjwe.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%2Fljx2gccbslimmtqcsjwe.png" alt="Image description" width="800" height="179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To edit the index.html file&lt;/strong&gt;&lt;br&gt;
To add content to the index.html file&lt;br&gt;
firstly you move to the location of the index.html file&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%2Fayrbn6j5uemtbrjz4u7t.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%2Fayrbn6j5uemtbrjz4u7t.png" alt="Image description" width="486" height="17"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next i checked if i had the write permission to the index.html file &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%2Fhrxiurvy039xq0imd0rx.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%2Fhrxiurvy039xq0imd0rx.png" alt="Image description" width="660" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i didn't have write permission to the index.html file so i had to grant myself that permission before i was able to edit the file&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%2Fqjpu0yr64w4o03g3mctu.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%2Fqjpu0yr64w4o03g3mctu.png" alt="Image description" width="524" height="20"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;after granting myself permission to the index.html file, i used nano to edit the file&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%2Fcsjes0ynpca757ejvc03.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%2Fcsjes0ynpca757ejvc03.png" alt="Image description" width="441" height="14"&gt;&lt;/a&gt;&lt;br&gt;
after editing the file, i used ctrl + s to save the file and ctrl + x to exit the file.&lt;/p&gt;

&lt;p&gt;next i restarted the nginx server&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%2Ftl5ysurk3oi9h7ztmbyv.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%2Ftl5ysurk3oi9h7ztmbyv.png" alt="Image description" width="556" height="17"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this point i copied the public ip of my ec2 instance and pasted it on my browser and it displayed the nginx page with the edits i made in it&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%2Fbv7pon7jbr5sguzoeg3w.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%2Fbv7pon7jbr5sguzoeg3w.png" alt="Image description" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenges and solutions proffered&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The major challenge i encountered was moving into the location of the index.html file. since i was using the amazon linux 2, the location of the index.html file wasn't /var/www/html. so i had to look for where the file was and i found it located at /usr/share/nginx/html&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Learning Outcome&lt;/strong&gt;&lt;br&gt;
This task has enabled me to learn the requirements for launching instances and hosting simple servers. It has also broaden my knowledge in the DevOps world.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://hng.tech/hire/devops-engineers" rel="noopener noreferrer"&gt;https://hng.tech/hire/devops-engineers&lt;/a&gt;&lt;br&gt;
&lt;a href="https://hng.tech/hire/linux-developers" rel="noopener noreferrer"&gt;https://hng.tech/hire/linux-developers&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
