<?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: Michael Nuertey</title>
    <description>The latest articles on DEV Community by Michael Nuertey (@macko).</description>
    <link>https://dev.to/macko</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%2F1408688%2Fd2a81ab0-456a-4098-a4dd-80bc9bfc8876.jpg</url>
      <title>DEV Community: Michael Nuertey</title>
      <link>https://dev.to/macko</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/macko"/>
    <language>en</language>
    <item>
      <title>Deploying a basic html page on AWS using Nginx</title>
      <dc:creator>Michael Nuertey</dc:creator>
      <pubDate>Fri, 31 Jan 2025 14:41:09 +0000</pubDate>
      <link>https://dev.to/macko/deploying-a-basic-html-page-on-aws-using-nginx-5bfh</link>
      <guid>https://dev.to/macko/deploying-a-basic-html-page-on-aws-using-nginx-5bfh</guid>
      <description>&lt;p&gt;Hi!!! This blog post is to narrate my experience and insights with my first task as an HNG intern. The task is quite simple and straight-forward, however, the lessons learned are invaluable.Ready????? Let's get to it.&lt;/p&gt;

&lt;p&gt;What you will learn:&lt;br&gt;
In this article, you will learn how to:&lt;/p&gt;

&lt;p&gt;Provision a server and install a Linux distribution of your choice on a cloud platform (AWS)&lt;/p&gt;

&lt;p&gt;Set up a web server (Nginx) to serve web content.&lt;/p&gt;

&lt;p&gt;Deploy a simple HTML page.&lt;/p&gt;

&lt;p&gt;Configure networking to allow HTTP traffic.&lt;/p&gt;

&lt;p&gt;Let's get started!&lt;/p&gt;
&lt;h3&gt;
  
  
  Provisioning a server and installing a Linux distribution
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;First, go to the AWS website (&lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;https://aws.amazon.com/&lt;/a&gt;) and log in to your AWS account. If you don't have an account, you'll need to create one.
Once logged in, you'll see the AWS Management Console. In the search bar at the top, type "EC2" and select the "EC2" service.&lt;/li&gt;
&lt;/ul&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%2F416latqggl8rn1gvxsbd.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%2F416latqggl8rn1gvxsbd.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On the EC2 dashboard, click the launch Instances button. This starts the instance launch wizard.&lt;/li&gt;
&lt;/ul&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%2Fffaredd1u9s7vu85bpu1.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%2Fffaredd1u9s7vu85bpu1.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.Choose an &lt;code&gt;Amazon Machine Image (AMI)&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An AMI is a template that contains the operating system and software configuration for your server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose your preferred Linux distribution; let's use Ubuntu.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fyrbm7eqgh0p7u8wm0p54.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%2Fyrbm7eqgh0p7u8wm0p54.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4.Choose an &lt;code&gt;Instance Type&lt;/code&gt;: The instance type determines the hardware resources allocated to your server (CPU, memory, storage).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For testing and simple web prototypes, the &lt;code&gt;t2.micro&lt;/code&gt; instance type is often sufficient and eligible for the AWS Free Tier (if you're eligible). 
Select &lt;code&gt;t2.micro&lt;/code&gt; or another instance type that meets your needs.&lt;/li&gt;
&lt;/ul&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%2Fxk84tmgg0f5xn2dypoel.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%2Fxk84tmgg0f5xn2dypoel.png" alt="Image description" width="800" height="141"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5.Select or Create a Key Pair&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A key pair is used to securely connect to your instance via SSH.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you don't have one, create a new key pair.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Give it a name (eg. &lt;code&gt;hng.pem&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download the &lt;code&gt;.pem&lt;/code&gt;file. This is extremely important. Store this file in a secure location. You will need it to connect to your instance.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fief09kas4q00vvqywtwv.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%2Fief09kas4q00vvqywtwv.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;6.Configure your instance details&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Number of instances: Set this to &lt;code&gt;1&lt;/code&gt; for this exercise.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Subnet: Select a subnet within your VPC. If you're using the default VPC, choose a &lt;code&gt;public subnet&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Auto-assign Public IP: Make sure this is enabled. This will give your instance a public IP address so you can access it from the internet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Leave other settings at their defaults unless you have specific requirements.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;7.Configure Security Group&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A &lt;code&gt;security group&lt;/code&gt; acts as a virtual firewall for your instance, controlling inbound and outbound traffic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new security group or select an existing one.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add the following inbound rules:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Type&lt;/em&gt;: &lt;code&gt;SSH&lt;/code&gt;, &lt;em&gt;Port Range&lt;/em&gt;: &lt;code&gt;22&lt;/code&gt;, &lt;em&gt;Source&lt;/em&gt;: &lt;code&gt;My IP&lt;/code&gt; (This is the most secure option. It allows SSH access only from your current IP address. If you need to access from other locations, you can specify a wider IP range or &lt;code&gt;0.0.0.0/0&lt;/code&gt;(less secure, allows access from any IP address).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Type&lt;/em&gt;: &lt;code&gt;HTTP&lt;/code&gt;, &lt;em&gt;Port Range&lt;/em&gt;: &lt;code&gt;80&lt;/code&gt;, &lt;em&gt;Source&lt;/em&gt;: &lt;code&gt;0.0.0.0/0&lt;/code&gt;(This allows HTTP traffic from any IP address, making your website publicly accessible).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fa04mjxi7fklrvveht7p6.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%2Fa04mjxi7fklrvveht7p6.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&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%2F6mj7vzmhcais2pzwbxo5.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%2F6mj7vzmhcais2pzwbxo5.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;9.Connect to Your Instance&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;After launching the instance, you'll be taken to the EC2 Instances dashboard. It might take a few minutes for the instance to start.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select your instance and copy its Public IPv4 address.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open a terminal or SSH client (like PuTTY on Windows, or the built-in terminal on macOS/Linux). We will use our Linux terminal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the following command:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-i&lt;/span&gt; /path/to/your/key.pem ubuntu@[your_instance_public_ip]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-i&lt;/span&gt; ~/Downloads/hng.pem ubuntu@54.172.49.241
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! You have now provisioned a server on AWS. You should be connected to your Ubuntu instance via SSH.&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%2F3uqwd16kdmjggishh1t7.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%2F3uqwd16kdmjggishh1t7.png" alt="Image description" width="800" height="212"&gt;&lt;/a&gt;&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%2Fi1ujxjdl9iowzkwmv3k2.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%2Fi1ujxjdl9iowzkwmv3k2.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&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%2Ftc0i7zroacl3ym5uxpft.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%2Ftc0i7zroacl3ym5uxpft.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Set up a web server
&lt;/h3&gt;

&lt;p&gt;We will use Apache in this instance. To install Nginx, we first need to update our packages. Input this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then install Nginx:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! You have set up your web server.&lt;br&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%2Fm4rp16rov84v98em5uee.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%2Fm4rp16rov84v98em5uee.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;br&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%2F7xmfriod57rpdhye8apa.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%2F7xmfriod57rpdhye8apa.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To ensure your nginx is enabled, input the following comands:&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 start nginx
sudo systemctl enable nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Input the public ip address of your ec2 instance and paste it in any browser of your choice. The Nginx page should be displayed.&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%2F5k7cy6dc3ig7qp6e6og9.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%2F5k7cy6dc3ig7qp6e6og9.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Deploy a simple HTML page
&lt;/h3&gt;

&lt;p&gt;To deploy our html page, we can create one on our terminal using this command:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This command takes you to an html page already on Nginx, you just have to format the template to your taste and save it. Type &lt;code&gt;ctrl+o&lt;/code&gt;to save your html content. Hit &lt;code&gt;ctrl+x&lt;/code&gt;to exit.&lt;/p&gt;

&lt;p&gt;Refresh your browser where you pasted the public ip address of your ec2 instance.&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%2Fn06ftetn6wrtour7cuk2.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%2Fn06ftetn6wrtour7cuk2.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&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%2F42yyqwh9zer9g4qk1a87.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%2F42yyqwh9zer9g4qk1a87.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenges
&lt;/h3&gt;

&lt;p&gt;This task has helped me sharpen deployment skills as a DevOps newbie.&lt;br&gt;
My main challenge was trying to connect to my ec2 instance, as I made errors writing the appropriate command. In the end, I figured it out.&lt;/p&gt;

&lt;p&gt;In addition, this project has put me in the right path to start my journey as a Cloud/DevOps engineer.&lt;br&gt;
Thanks for reading, watch this space for more articles and projects.&lt;/p&gt;

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

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

</description>
    </item>
    <item>
      <title>A Technical Guide to Cloud-Based Web Prototype Deployment</title>
      <dc:creator>Michael Nuertey</dc:creator>
      <pubDate>Mon, 30 Dec 2024 14:30:45 +0000</pubDate>
      <link>https://dev.to/macko/a-technical-guide-to-cloud-based-web-prototype-deployment-2dl8</link>
      <guid>https://dev.to/macko/a-technical-guide-to-cloud-based-web-prototype-deployment-2dl8</guid>
      <description>&lt;p&gt;Cloud computing has transmuted the way we develop and deploy software, offering scalability, flexibility, and cost-effectiveness. In this article, I will guide you through the process of provisioning a server on a cloud platform and setting up a simple landing page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you will learn:&lt;/strong&gt;&lt;br&gt;
In this article, you will learn how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Provision a server and install a Linux distribution of your choice on a cloud platform (AWS)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set up a web server (Apache or Nginx) to serve web content.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deploy a simple HTML page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure networking to allow HTTP traffic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Optionally, configure HTTPS for secure communication.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's get started&lt;/p&gt;
&lt;h3&gt;
  
  
  Provisioning a server and installing a Linux distribution
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;First, go to the AWS website (&lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;https://aws.amazon.com/&lt;/a&gt;) and log in to your AWS account. If you don't have an account, you'll need to create one.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Once logged in, you'll see the AWS Management Console. In the search bar at the top, type "EC2" and select the "EC2" service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the EC2 dashboard, click the &lt;code&gt;launch Instances&lt;/code&gt; button. This starts the instance launch wizard.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Choose an &lt;code&gt;Amazon Machine Image (AMI)&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An AMI is a template that contains the operating system and software configuration for your server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose your preferred Linux distribution; let's use &lt;code&gt;Ubuntu&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.Choose an &lt;code&gt;Instance Type&lt;/code&gt;: The instance type determines the hardware resources allocated to your server (CPU, memory, storage).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For testing and simple web prototypes, the &lt;code&gt;t2.micro&lt;/code&gt; instance type is often sufficient and eligible for the AWS Free Tier (if you're eligible). 
Select &lt;code&gt;t2.micro&lt;/code&gt; or another instance type that meets your needs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.Configure your instance details&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Number of instances: Set this to &lt;code&gt;1&lt;/code&gt; for this exercise.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Subnet: Select a subnet within your VPC. If you're using the default VPC, choose a &lt;code&gt;public subnet&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Auto-assign Public IP: Make sure this is enabled. This will give your instance a public IP address so you can access it from the internet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Leave other settings at their defaults unless you have specific requirements.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5.Add Storage&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can accept the default storage settings or customize the size and type of storage for your instance. For a simple web prototype, the default is usually sufficient.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;6.Add Tags (Recommended)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tags are key-value pairs that help you organize and manage your AWS resources. Add a tag like &lt;code&gt;Name=MyWebAppServer&lt;/code&gt; to easily identify your instance later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;7.Configure Security Group&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A &lt;code&gt;security group&lt;/code&gt; acts as a virtual firewall for your instance, controlling inbound and outbound traffic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new security group or select an existing one.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add the following inbound rules:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Type&lt;/em&gt;: &lt;code&gt;SSH&lt;/code&gt;, &lt;em&gt;Port Range&lt;/em&gt;: &lt;code&gt;22&lt;/code&gt;, &lt;em&gt;Source&lt;/em&gt;: &lt;code&gt;My IP&lt;/code&gt; (This is the most secure option. It allows SSH access only from your current IP address. If you need to access from other locations, you can specify a wider IP range or &lt;code&gt;0.0.0.0/0&lt;/code&gt;(less secure, allows access from any IP address).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Type&lt;/em&gt;: &lt;code&gt;HTTP&lt;/code&gt;, &lt;em&gt;Port Range&lt;/em&gt;: &lt;code&gt;80&lt;/code&gt;, &lt;em&gt;Source&lt;/em&gt;: &lt;code&gt;0.0.0.0/0&lt;/code&gt;(This allows HTTP traffic from any IP address, making your website publicly accessible).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;8.Select or Create a Key Pair&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A key pair is used to securely connect to your instance via SSH.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you don't have one, create a new key pair.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Give it a name (eg. &lt;code&gt;mike.pem&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download the &lt;code&gt;.pem&lt;/code&gt;file. This is extremely important. Store this file in a secure location. You will need it to connect to your instance.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;9.Connect to Your Instance&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;After launching the instance, you'll be taken to the EC2 Instances dashboard. It might take a few minutes for the instance to start.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select your instance and copy its Public IPv4 address.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open a terminal or SSH client (like PuTTY on Windows, or the built-in terminal on macOS/Linux). We will use our Linux terminal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the following command:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-i&lt;/span&gt; /path/to/your/key.pem ubuntu@[your_instance_public_ip]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-i&lt;/span&gt; ~/Downloads/mike.pem ubuntu@54.123.45.67
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! You have now provisioned a server on AWS. You should be connected to your Ubuntu instance via SSH.&lt;/p&gt;

&lt;h3&gt;
  
  
  Set up a web server
&lt;/h3&gt;

&lt;p&gt;We will use Apache in this instance. To install Apache, we first need to update our packages. Input this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then install Apache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;apache2 &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! You have set up your web server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deploy a simple HTML page
&lt;/h3&gt;

&lt;p&gt;To deploy our html page, we can create one on our terminal using this command:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This command takes you to an html page already on Apache, you just have to format the template to your taste and save it. Type &lt;code&gt;ctrl+o&lt;/code&gt;to save your html content. Hit &lt;code&gt;ctrl+x&lt;/code&gt;to exit.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure networking to allow HTTP traffic
&lt;/h3&gt;

&lt;p&gt;We did this during our creation of the security group for our ec2 instance. You can check to make sure it has been properly configured.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Navigate to ec2 on your AWS management console.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the left-hand navigation pane, under &lt;code&gt;Network &amp;amp; Security&lt;/code&gt;, click on &lt;br&gt;
&lt;code&gt;Security Groups&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Find the security group that you associated with your EC2 instance when &lt;br&gt;
you launched it. Select the security group.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on the &lt;code&gt;Inbound rules&lt;/code&gt; tab.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click the &lt;code&gt;Edit inbound rules&lt;/code&gt; button.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;code&gt;Add rule&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Type&lt;/em&gt;: Select &lt;code&gt;HTTP&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Port Range&lt;/em&gt;: This will automatically be set to &lt;code&gt;80&lt;/code&gt;(the standard port &lt;br&gt;
for HTTP).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Source&lt;/em&gt;: This determines which IP addresses can access your instance on &lt;br&gt;
port 80. Choose &lt;code&gt;0.0.0.0/0&lt;/code&gt;. Suitable for this exercise.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Configure HTTPS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;For HTTPS to work correctly, you need to allow traffic from all sources &lt;code&gt;0.0.0.0/0&lt;/code&gt; on &lt;code&gt;port 443&lt;/code&gt; in your security group. The actual encryption is handled by the SSL/TLS certificate and your web server software.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;code&gt;save rules&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To test if your prototype works, copy the public IP address of your instance. Paste it in any browser. You should see your site display.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To install an SSL certificate, you need a domain name for your site. Choose any free domain site of your choice or a paid one for a more customized domain and point it to your instance public address.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once this is done, input this commands to install the SSL certificate:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;certbot python3-certbot-apache &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;certbot &lt;span class="nt"&gt;--apache&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &amp;lt;domain or url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations!You just enabled HTTPS and installed an SSL certificate.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;With your web prototype now live in the cloud, you have a solid foundation for further development and iteration. This process provides a rapid and cost-effective way to bring your web application ideas to life.&lt;/p&gt;

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