<?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: Adaeze Nnamdi-Udekwe</title>
    <description>The latest articles on DEV Community by Adaeze Nnamdi-Udekwe (@clouddiadem).</description>
    <link>https://dev.to/clouddiadem</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%2F1350275%2Fe9657924-4a24-46c0-ab15-0f49e0c3cba7.jpeg</url>
      <title>DEV Community: Adaeze Nnamdi-Udekwe</title>
      <link>https://dev.to/clouddiadem</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/clouddiadem"/>
    <language>en</language>
    <item>
      <title>Gxcc</title>
      <dc:creator>Adaeze Nnamdi-Udekwe</dc:creator>
      <pubDate>Sun, 28 Jul 2024 01:58:12 +0000</pubDate>
      <link>https://dev.to/clouddiadem/gxcc-266a</link>
      <guid>https://dev.to/clouddiadem/gxcc-266a</guid>
      <description>&lt;p&gt;Vvb ccv xfv. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hosting Your Company's landing page (static website) on Google Cloud Using HTTPS &amp; HTTP With Azure DNS Zone record</title>
      <dc:creator>Adaeze Nnamdi-Udekwe</dc:creator>
      <pubDate>Tue, 04 Jun 2024 14:16:21 +0000</pubDate>
      <link>https://dev.to/clouddiadem/hosting-your-companys-landing-page-static-website-on-google-cloud-using-https-http-with-azure-dns-zone-record-3n58</link>
      <guid>https://dev.to/clouddiadem/hosting-your-companys-landing-page-static-website-on-google-cloud-using-https-http-with-azure-dns-zone-record-3n58</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Imagine getting a job or being assigned a task in your organization, probably as a new intern to host the company's website on Google Cloud but you must use a load balancer to share network traffic appropriately and also secure it using an SSL certificate. Do you know how to do that? If not, let's walk through it together.&lt;/p&gt;

&lt;p&gt;In today's digital environment, businesses of all sizes must manage cloud resources effectively and securely. Businesses depend more on cloud infrastructure, so grasping the fundamental ideas and resources is critical. This article aims to explain a few basic features of Google Cloud Platform (GCP) and offer a step-by-step tutorial for creating a landing page with GCP services and your domain name.&lt;/p&gt;

&lt;p&gt;Definitions of important terms like landing pages, folders, projects, DNS zones, and static websites will be covered. After that, we'll go over the actual procedures for setting up a safe and orderly cloud environment. After reading this article, you should be able to deploy a static website on GCP using your domain name, manage access controls, and easily arrange cloud resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  Definitions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Folders&lt;/strong&gt;: For your cloud resources, you can set up an orderly and controllable structure that will guarantee effective access control, billing management, and compliance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Projects&lt;/strong&gt;: They offer a mechanism to enforce quotas, manage billing, restrict access, and hierarchically arrange resources. To manage your GCP environment effectively and securely, you must understand how to use projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DNS Zone&lt;/strong&gt;: You can arrange and manage DNS records for your domain names with DNS Zones. They can be private for internal use only within your VPC networks, or public for access to the internet. These zones are yours to make and maintain, and you can add different kinds of DNS records as needed. For domain names to correctly resolve to their corresponding IP addresses and for other services, DNS zone management is essential.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Static Website&lt;/strong&gt;: Google Cloud Storage makes it simple to host a static website on Google Cloud Platform.  Benefits include GCP's performance, dependability, and scalability. For websites where content doesn't need to be dynamically generated or updated often, this method is perfect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Landing Page&lt;/strong&gt;: With Google Cloud Storage, a landing page on Google Cloud Platform can be hosted effectively. This strategy makes use of GCP's strong infrastructure to provide your audience with high-performance static content while emphasizing simplicity, speed, and security.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Step 1: Create folder, project &amp;amp; Permission grant to Cloud Developer
&lt;/h3&gt;

&lt;p&gt;i. Log into the &lt;a href="https://console.cloud.google.com/" rel="noopener noreferrer"&gt;google console&lt;/a&gt; you created your company domain name. My own domain name for this project is &lt;strong&gt;adaezennamdi.me&lt;/strong&gt;. You should have yours which should have been added to a record set on DNS Zone and also mapped on a name server.&lt;/p&gt;

&lt;p&gt;ii. On your search in your console, search for &lt;strong&gt;manage resource&lt;/strong&gt; and click on it. Click on &lt;strong&gt;create folder&lt;/strong&gt;, then &lt;strong&gt;folder&lt;/strong&gt;, and name it &lt;strong&gt;Landing Page&lt;/strong&gt;. The &lt;strong&gt;Organization&lt;/strong&gt; and &lt;strong&gt;Location&lt;/strong&gt; should all be your website organization name then click &lt;strong&gt;create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fmk1atbooh0d8sqg3arfy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fmk1atbooh0d8sqg3arfy.png" alt="Folders"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. Click on &lt;strong&gt;Create Project&lt;/strong&gt; to create a project called &lt;strong&gt;landing page&lt;/strong&gt;. The &lt;strong&gt;Organization&lt;/strong&gt; should be your website organization name and the &lt;strong&gt;Location&lt;/strong&gt;, click on &lt;strong&gt;browse&lt;/strong&gt; and pick &lt;strong&gt;Landing Page&lt;/strong&gt;. Go ahead and click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fssts29cgom3mtkx53uip.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fssts29cgom3mtkx53uip.png" alt="project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It would be best if you had something like this below if you are following the steps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fnul4j8agzdtp2dnijcfb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fnul4j8agzdtp2dnijcfb.png" alt="organisation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. Grant permission to user (owner) &lt;code&gt;gcpcloudadmin&lt;/code&gt;. I have created a cloud admin before. Go ahead and create yours and give the admin account owner permission because that is the account we are using to do this project. Click on the pencil icon and &lt;strong&gt;edit principal&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F12fsi3t6fnvljy9bhsbg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F12fsi3t6fnvljy9bhsbg.png" alt="admin"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;v. Click on Role&amp;gt;&amp;gt; Basic&amp;gt;&amp;gt;Owner. Click on &lt;strong&gt;save&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fg9hd10i96e2enab06ba4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fg9hd10i96e2enab06ba4.png" alt="Role"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Download the Source Code and Test
&lt;/h3&gt;

&lt;p&gt;i. We will be using a source code gotten from a template &lt;a href="https://www.tooplate.com/free-templates#google_vignette" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Download any HTML template. I will be using this &lt;a href="https://www.tooplate.com/view/2131-wedding-lite" rel="noopener noreferrer"&gt;one&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;ii. Open the downloaded file and unzip it. We will be using the folders and files in our bucket.&lt;/p&gt;

&lt;p&gt;iii. Test the code with your vs code to see the way the website looks. Open the unzipped folder with VS Code and open it on the browser by clicking below it where it says &lt;strong&gt;go live&lt;/strong&gt; from the image below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fd39tdzqs0ou2frhaiwmq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fd39tdzqs0ou2frhaiwmq.png" alt="VS code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is what I have after going live to test the sourced codes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Feezuxpatijowpelum7zc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Feezuxpatijowpelum7zc.png" alt="website page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Create a Bucket with the Company's domain and upload web files
&lt;/h3&gt;

&lt;p&gt;i. Verify your company domain name first with this link below (&lt;a href="https://search.google.com/search-console?authuser=1" rel="noopener noreferrer"&gt;https://search.google.com/search-console?authuser=1&lt;/a&gt;). Input your domain name and click &lt;strong&gt;continue&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fjygkpblwn50ttp4oqkc1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fjygkpblwn50ttp4oqkc1.png" alt="verify"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ii. Copy the code for verification and follow the prompt written. After which, come back to verify and you will see something like this. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F7u5yk8hcfe51661uc9mr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F7u5yk8hcfe51661uc9mr.png" alt="verify again"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. When you click on &lt;strong&gt;go to property&lt;/strong&gt;, you will see an overview of what the performance of your website will be when it is hosted and visited.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fdcbtf322tmca49vr0kat.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fdcbtf322tmca49vr0kat.png" alt="performance"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. Create a bucket using the company's root domain name which you verified from the previous step. Go back to your google console and search for &lt;strong&gt;cloud storage&lt;/strong&gt;. Click on it and click &lt;strong&gt;bucket&lt;/strong&gt;. You will be asked to pick a project. Click the &lt;strong&gt;landing page&lt;/strong&gt; project we created earlier in Step 1.&lt;/p&gt;

&lt;p&gt;v. Click on enable billing before you proceed else you would not be able to use any of the services or resources.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F8s9u191zegb8cyg7t970.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F8s9u191zegb8cyg7t970.png" alt="billing"&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;vi. If you do not have up to 3 projects attached to your billing account, it should work for you and look like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1glsv1q868pv640b12nu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1glsv1q868pv640b12nu.png" alt="billing again"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;vii. In your search bar, search for &lt;strong&gt;IAM &amp;amp; Admin&lt;/strong&gt; and click on it. Click on &lt;strong&gt;IAM&lt;/strong&gt; then on &lt;strong&gt;Grant Access&lt;/strong&gt;. For &lt;strong&gt;New Principal&lt;/strong&gt;, put your organization name. Mine is &lt;code&gt;adaezennamdi.me&lt;/code&gt;. For &lt;strong&gt;Role&lt;/strong&gt;, type and click on &lt;code&gt;Organization Policy Administrator&lt;/code&gt;. Then click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Flb5mo4826u835yiynlaq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Flb5mo4826u835yiynlaq.png" alt="Policy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;viii. You would see the policy just like this against your organization. This policy will give you permission to grant all users public access to your bucket storage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fcwip7xrg7ojggnsqmbuo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fcwip7xrg7ojggnsqmbuo.png" alt="organization"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ix. Under &lt;strong&gt;IAM &amp;amp; Admin&lt;/strong&gt;, click on &lt;strong&gt;Organization Policies&lt;/strong&gt; by your left-hand side. In the filter search bar, type domain and pick &lt;code&gt;constraints/iam.allowedPolicyMemberDomains&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Ff2lc9ys707vmszqa5mnf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ff2lc9ys707vmszqa5mnf.png" alt="domain policy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;x. For &lt;strong&gt;Policy source&lt;/strong&gt;,pick &lt;strong&gt;overide parent's policy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;xi. For Rule, edit it to &lt;strong&gt;allow all&lt;/strong&gt;. Click &lt;strong&gt;set policy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1cv77lmvsesqf61tn21g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1cv77lmvsesqf61tn21g.png" alt="Rule"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;xii. You should have something like this after setting the policy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fuku08q0bto7oagwkgf7i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fuku08q0bto7oagwkgf7i.png" alt="policy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;xiii. Go back to your bucket. On your created bucket, click the 3 vertical dots by your extreme right and click on &lt;strong&gt;edit access&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fb3t0nji5h2xoy26nz7yg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fb3t0nji5h2xoy26nz7yg.png" alt="edit access"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;xiv. For &lt;strong&gt;New Principal&lt;/strong&gt;, put &lt;code&gt;allUsers&lt;/code&gt;. For &lt;strong&gt;Role&lt;/strong&gt;, type and click on &lt;code&gt;Storage Object Viewer&lt;/code&gt;. Then click &lt;strong&gt;Save&lt;/strong&gt;. This is to make all users over the internet see your website. Click &lt;strong&gt;Save&lt;/strong&gt; and you will be prompted with &lt;strong&gt;Allow public access&lt;/strong&gt;. Click on it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fmvu69rvkeeg34yh4uq0v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fmvu69rvkeeg34yh4uq0v.png" alt="website"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;xv. Under your created bucket, upload all the files of the template you want to use, then the folders.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fribg4m6mfbz0pjdxh5vf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fribg4m6mfbz0pjdxh5vf.png" alt="template"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;xvi. Click on your bucket name and then scroll down through the files and click on the 3 vertical lines on &lt;strong&gt;index.hmtl&lt;/strong&gt;. Click on &lt;strong&gt;Copy Public URL&lt;/strong&gt;. copy the link and paste on your browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fyd0fc7i6ozsulz6icx9d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fyd0fc7i6ozsulz6icx9d.png" alt="public url"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;xvii. Your URL should look like this but with your own bucket name. This is the website I hosted shown below. You will see that your URL is not customized to carry your domain name. We will work on that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fal189xt3rhxsyxzqor30.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fal189xt3rhxsyxzqor30.png" alt="DNS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Set up HTTPS Load Balancer with SSL Certificate)
&lt;/h3&gt;

&lt;p&gt;i. On your google console, navigate to your load balancer page by searching for the service inside the console. If you are asked to enable API for &lt;strong&gt;Compute Engine&lt;/strong&gt;, click the button.&lt;/p&gt;

&lt;p&gt;ii. Click on &lt;strong&gt;create load balancer&lt;/strong&gt; to start the process. Click on any of the &lt;strong&gt;create load balancer&lt;/strong&gt; you see.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F23s3duxxok5z3k4o268p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F23s3duxxok5z3k4o268p.png" alt="create load balancer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. For &lt;strong&gt;Type of load balancer&lt;/strong&gt;,pick &lt;strong&gt;Application Load Balancer (HTTP/HTTPS)&lt;/strong&gt;,then click &lt;strong&gt;next&lt;/strong&gt;. For &lt;strong&gt;Public facing or internal&lt;/strong&gt;, pick &lt;strong&gt;Public facing (external)&lt;/strong&gt; and click &lt;strong&gt;next&lt;/strong&gt;. For &lt;strong&gt;Global or single region deployment&lt;/strong&gt;, click &lt;strong&gt;Best for global workloads&lt;/strong&gt;. Click &lt;strong&gt;next&lt;/strong&gt;. For &lt;strong&gt;Load balancer generation&lt;/strong&gt;, click &lt;strong&gt;Global external Application Load Balancer&lt;/strong&gt; and then &lt;strong&gt;next&lt;/strong&gt;. Click &lt;strong&gt;configure&lt;/strong&gt; to Create load balancer.&lt;/p&gt;

&lt;p&gt;iv. For &lt;strong&gt;load balancer name&lt;/strong&gt;,call it &lt;strong&gt;landingpage-lb&lt;/strong&gt;. Under &lt;strong&gt;Frontend configuration&lt;/strong&gt;,name it &lt;strong&gt;landingpage-frontend&lt;/strong&gt;. For &lt;strong&gt;protocol&lt;/strong&gt;,pick &lt;strong&gt;HTTPS&lt;/strong&gt;. For &lt;strong&gt;port&lt;/strong&gt;,put &lt;strong&gt;443&lt;/strong&gt;. For &lt;strong&gt;Ip address&lt;/strong&gt;, click on the drop-down and click &lt;strong&gt;create IP address&lt;/strong&gt;. Name it &lt;strong&gt;landing-pub-ip&lt;/strong&gt; and click &lt;strong&gt;Reserve&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F4vwf77wiuu0wivqbbyz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F4vwf77wiuu0wivqbbyz0.png" alt="Reserve"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;v. Under &lt;strong&gt;certificate&lt;/strong&gt;, click on &lt;strong&gt;create a new certificate&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1d50fjkhrhqc2638ojsc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1d50fjkhrhqc2638ojsc.png" alt="create a new certificate"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;vi. For name of certificate,let the name be &lt;strong&gt;landing-cert&lt;/strong&gt;. For &lt;strong&gt;Create mode&lt;/strong&gt;, click on &lt;strong&gt;Create Google-managed certificate&lt;/strong&gt;. For &lt;strong&gt;Domains&lt;/strong&gt;, input your domain name for the first one and add &lt;code&gt;www&lt;/code&gt; to the domain name for the second domain name. Click on &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Faz6pftfqdvozbrwvb48r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Faz6pftfqdvozbrwvb48r.png" alt="create certificate"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;vii. Under Additional Certificates, let &lt;strong&gt;SSL Policy&lt;/strong&gt; be &lt;strong&gt;GCP Default&lt;/strong&gt;. Let &lt;strong&gt;HTTP/3 (QUIC) negotiation&lt;/strong&gt; be left as &lt;strong&gt;default&lt;/strong&gt;. Check the box &lt;strong&gt;Enable HTTP to HTTPS redirect&lt;/strong&gt; and click &lt;strong&gt;done&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;viii. For &lt;strong&gt;Backend configuration&lt;/strong&gt;, click on the dropdown &lt;strong&gt;backend services &amp;amp; backend buckets&lt;/strong&gt; and click &lt;strong&gt;create a backend bucket&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1e5b48iq5bofnvwgkazq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1e5b48iq5bofnvwgkazq.png" alt="backend"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ix. For &lt;strong&gt;Backend bucket name&lt;/strong&gt;, let it be &lt;strong&gt;landing-backend&lt;/strong&gt;. For &lt;br&gt;
&lt;strong&gt;Cloud Storage bucket&lt;/strong&gt; click on &lt;strong&gt;browse&lt;/strong&gt;. Select the bucket you create earlier on and click &lt;strong&gt;select&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fk55ex5biqt14ku4yawn0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fk55ex5biqt14ku4yawn0.png" alt="backend bucket name"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;x. For &lt;strong&gt;Cloud CDN&lt;/strong&gt;, tick &lt;strong&gt;Enable Cloud CDN&lt;/strong&gt;.For Client TTL, Default TTL, and Maximum TTL, leave them with the default value.Leave every other parameter as default and click &lt;strong&gt;create&lt;/strong&gt;. Click &lt;strong&gt;OK&lt;/strong&gt; on the next prompt you see.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fn41aqj14wtgb7te0with.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fn41aqj14wtgb7te0with.png" alt="TTL"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;xi. For &lt;strong&gt;Routing rules&lt;/strong&gt;,leave everything as default. Click on &lt;strong&gt;Review and finalize&lt;/strong&gt;  and make sure everything is in order and then click &lt;strong&gt;create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fqyifuk0b25jy6xh872tn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fqyifuk0b25jy6xh872tn.png" alt="routing rules"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;xii. You should see something like this with the green checkmarks. if someone is trying to visit your website,with the information below,the person will be redirected to https.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fh7vs5qsmx9180ey8pvcj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fh7vs5qsmx9180ey8pvcj.png" alt="https"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Create a domain record in Azure DNS Zone
&lt;/h3&gt;

&lt;p&gt;i. Click on the link called &lt;strong&gt;landingpage-lb&lt;/strong&gt; from the image above. Copy the IP address there. You will go and map it in your DNS server where you created the domain name and mapped your txt record. In my case, I used Azure DNS zone. If you did this &lt;a href="https://dev.to/clouddiadem/step-by-step-guide-setting-up-azure-entra-id-with-domain-names-and-user-management-3dno"&gt;project&lt;/a&gt;, under &lt;em&gt;step 5,number vi&lt;/em&gt;,where we added a record for Azure. You will add same for google too in same place. That is why I am using same account carrying my domain name to map &lt;code&gt;A record&lt;/code&gt; and &lt;code&gt;CNAME record&lt;/code&gt;. The image below is for &lt;code&gt;A record&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;ii. If you used azure to map your own records,then go to your azure portal, navigate to &lt;strong&gt;DNS ZONE&lt;/strong&gt;, then click on &lt;strong&gt;DNS Management&lt;/strong&gt; and &lt;strong&gt;recordsets&lt;/strong&gt; under it. Click on &lt;strong&gt;Add&lt;/strong&gt; to add record set.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fy2gpginilh6ddnj56hkd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fy2gpginilh6ddnj56hkd.png" alt="DNS zone"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. Name can be empty or you use @, Type should be A-Address Record, IP address should be the IP address from your load balancer you created from earlier step under &lt;strong&gt;IP:Port&lt;/strong&gt;. Leave everything else at default and click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fh9sseyr0cz7fg5av2uc9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fh9sseyr0cz7fg5av2uc9.png" alt="IP port"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. We will add another record type called CNAME.&lt;strong&gt;Name&lt;/strong&gt; should be &lt;em&gt;www&lt;/em&gt; and &lt;strong&gt;Type&lt;/strong&gt; should be &lt;strong&gt;CNAME record&lt;/strong&gt;. Your domain name will automatically show as your &lt;strong&gt;alias&lt;/strong&gt;. Then click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F0dp5qe2ybmnonfuzqe0l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F0dp5qe2ybmnonfuzqe0l.png" alt="CNAME"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;V. It will be mapped to your domain name like this even if you don't add it, as long as you are doing it under the domain name record.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fmyimqb1hnu9bc8kxdusn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fmyimqb1hnu9bc8kxdusn.png" alt="domain name"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;vi. Use a &lt;a href="https://dnschecker.org/" rel="noopener noreferrer"&gt;DNS Checker&lt;/a&gt; to see that your domain name propagates across the world and it shows the IP address you inputted in the A record.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fese1xpj7eer5356ixuv3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fese1xpj7eer5356ixuv3.png" alt="DNS checker"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;vii. Do the same for CNAME records too.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fvcscmufecwwofhgklf26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fvcscmufecwwofhgklf26.png" alt="CNAME"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;viii. You should see this on the certificate page after some minutes. It would have provisioned.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F0npb483z3birvwtjseku.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F0npb483z3birvwtjseku.png" alt="provision"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ix. You will see your website if you use the CNAME record with &lt;code&gt;www.your domain name&lt;/code&gt;, and if you input just &lt;code&gt;your domain name&lt;/code&gt;, you will see your website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F9s9zcyfktgqec1nreyeh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9s9zcyfktgqec1nreyeh.png" alt="domain name"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;x. When you are done, delete your resources like bucket storage, load balancer, and SSL certificate in your google console.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Multiple steps are involved in setting up and maintaining a landing page on Google Cloud Platform, all of which contribute to a stable and secure cloud environment. You can guarantee effective access control, billing, and compliance management through comprehension and application of GCP's resources, including Folders, Projects, and DNS Zones. Performance, dependability, and scalability are just a few advantages that make hosting a static website on GCP a great option for many businesses.&lt;/p&gt;

&lt;p&gt;This detailed documented steps thoroughly explain how to create a GCP project, configure required permissions, confirm domain ownership, and launch a static webpage. By following these procedures, you can use GCP's robust infrastructure to provide your audience with high-performance static content and guarantee a smooth and effective experience.&lt;/p&gt;

&lt;p&gt;I would love to know if you found this helpful and if you could try it out. Your likes and comments will go a long way in encouraging me to keep writing more. See you in my next article!&lt;/p&gt;

</description>
      <category>googlecloud</category>
      <category>dnsserver</category>
      <category>dnsnamerecord</category>
      <category>azure</category>
    </item>
    <item>
      <title>Hosting a Static Website with CloudFront and AWS S3</title>
      <dc:creator>Adaeze Nnamdi-Udekwe</dc:creator>
      <pubDate>Mon, 13 May 2024 18:27:42 +0000</pubDate>
      <link>https://dev.to/clouddiadem/hosting-a-static-website-with-cloudfront-and-aws-s3-g8c</link>
      <guid>https://dev.to/clouddiadem/hosting-a-static-website-with-cloudfront-and-aws-s3-g8c</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;Create a static website on Amazon S3 bucket(private bucket) but with public read policy assigned, using cloud front for Content Delivery Network. &lt;/p&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;If I were to get married again, I'd probably host our wedding invite and love story on an AWS S3 bucket and use an OAI (Origin Access Identity) in CloudFront to restrict access to the AWS S3 bucket if I wanted to invite you strictly by invitation.😉 Well, let us host a wedding invite in this project whose template I got &lt;a href="https://www.tooplate.com/free-templates" rel="noopener noreferrer"&gt;here&lt;/a&gt;. You can use any of the templates from here too.&lt;/p&gt;

&lt;h3&gt;
  
  
  Amazon S3
&lt;/h3&gt;

&lt;p&gt;Amazon Web Services (AWS) provides scalable, high-performance object storage with its Amazon S3 (Simple Storage Service) offering. A key element of Amazon S3 is an S3 bucket, which serves as a container for objects (files and the metadata that goes with them) in a flat namespace. &lt;/p&gt;

&lt;h3&gt;
  
  
  Static Website
&lt;/h3&gt;

&lt;p&gt;Without any dynamic server-side processing, a static website is one that is made up of fixed, pre-built HTML, CSS, and JavaScript files that are sent straight to the user's web browser. This indicates that during a user's session, the content on the website remains unchanged regardless of user interactions or input from outside sources. Businesses and individuals looking for a quick, safe, and simple way to maintain an online presence for informative content, including landing pages, blogs, or portfolios, should consider using static websites.&lt;/p&gt;

&lt;h3&gt;
  
  
  Amazon CloudFront
&lt;/h3&gt;

&lt;p&gt;A service offered by Amazon Web Services (AWS) is Amazon CloudFront, a content delivery network (CDN). Its goal is to provide high transfer speeds and minimal latency in content delivery to end consumers globally. Application data and both static and dynamic content can be delivered more quickly to users in various geographical locations when using CloudFront. &lt;br&gt;
Employing Amazon CloudFront enables businesses to deliver their apps and content closer to end users, improving speed and availability and resulting in quicker load times and an improved user experience.&lt;/p&gt;

&lt;p&gt;You can also set up Access Control with OAI (Origin Access Identity) to restrict direct access to the S3 bucket, allowing access only through CloudFront, which we are going to be using for this project.&lt;/p&gt;


&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;An AWS account&lt;/li&gt;
&lt;li&gt;The files to upload for your static website.&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Step 1: Create a Bucket on Amazon S3
&lt;/h3&gt;

&lt;p&gt;i. Log into your AWS console and use the search bar to search for &lt;strong&gt;S3&lt;/strong&gt; and click on it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F9ec43daa-1ede-496c-852e-fa36d570c081" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F9ec43daa-1ede-496c-852e-fa36d570c081" alt="S3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ii. Click on &lt;strong&gt;create bucket&lt;/strong&gt; so as to input your bucket name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F60f3d487-3437-49b4-8c83-e3b537d1df86" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F60f3d487-3437-49b4-8c83-e3b537d1df86" alt="bucket"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. Input a bucket name in the &lt;strong&gt;Bucket name&lt;/strong&gt; with a unique name which has not been used before. Go ahead and untick &lt;strong&gt;Block all public access&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Ff1fa2ded-6659-4d5d-99ea-b72ac321e03f" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Ff1fa2ded-6659-4d5d-99ea-b72ac321e03f" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. Scroll down and click the &lt;strong&gt;acknowledgment&lt;/strong&gt; box.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F097104e0-9fc0-4a04-850f-2f859568728d" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F097104e0-9fc0-4a04-850f-2f859568728d" alt="acknowledgment"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. Leave every other thing as default and scroll down and click &lt;strong&gt;create bucket&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F8072c6f8-fb78-41b1-8ab7-ef9c824d61f9" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F8072c6f8-fb78-41b1-8ab7-ef9c824d61f9" alt="create bucket"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 2: Upload Website files to S3 Bucket
&lt;/h3&gt;

&lt;p&gt;i. Click on the bucket name so you can upload your website files into the bucket.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fa78a6759-43ed-4549-97f3-ee53da2b29c6" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fa78a6759-43ed-4549-97f3-ee53da2b29c6" alt="my wedding invitation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ii. Click on &lt;strong&gt;upload&lt;/strong&gt; and select the files from your local file storage. Do well not to upload the overall folder carrying the other folders. Upload the folders one after the other so it opens on your browser along the line. Make sure that index.html resides in the root directory of the bucket.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F5753c604-1914-4e47-91a5-5e219b0bda3d" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F5753c604-1914-4e47-91a5-5e219b0bda3d" alt="upload"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. Click on &lt;strong&gt;upload folders&lt;/strong&gt; and upload your folders from there. You can upload a file if that is what you have.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F83eceb19-8b4c-47f2-81ad-a21a7e645ea2" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F83eceb19-8b4c-47f2-81ad-a21a7e645ea2" alt="upload folders"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. After uploading the folders from your local file storage, click on &lt;strong&gt;Upload&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fdcd58e92-6c6c-4ada-98a4-8663e63da07a" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fdcd58e92-6c6c-4ada-98a4-8663e63da07a" alt="upload"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;v. Give it some time to populate and upload. You will eventually see a small green banner after a while to indicate that it was successful.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fa3072693-a99b-46e5-a753-18a312f41fa9" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fa3072693-a99b-46e5-a753-18a312f41fa9" alt="populatw"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Ffdf2c8cf-2a2d-4a1e-8f0a-ff95498cc8d1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Ffdf2c8cf-2a2d-4a1e-8f0a-ff95498cc8d1" alt="successful"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 3:Enable Static Website Hosting on S3 Bucket Created
&lt;/h3&gt;

&lt;p&gt;i. Click on the &lt;strong&gt;close&lt;/strong&gt; button and see all your files or folders. Click on the &lt;strong&gt;Properties&lt;/strong&gt; tabs and scroll down to &lt;strong&gt;Static website hosting&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F71fb0efe-4f2c-41e4-b71d-7ff721af1830" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F71fb0efe-4f2c-41e4-b71d-7ff721af1830" alt="Static website hosting"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ii. Click on &lt;strong&gt;Edit&lt;/strong&gt; on &lt;strong&gt;Static website hosting&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Ffd3f19e7-a597-4112-bc00-5384b67c1350" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Ffd3f19e7-a597-4112-bc00-5384b67c1350" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. Click on the radio button &lt;strong&gt;Enable&lt;/strong&gt;. Under &lt;strong&gt;hosting type&lt;/strong&gt;, click on &lt;strong&gt;Host a static website&lt;/strong&gt;. Under &lt;strong&gt;Index document&lt;/strong&gt;, type &lt;em&gt;index.html&lt;/em&gt; in it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fc47d1f79-a154-4026-80b8-652d2b86d751" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fc47d1f79-a154-4026-80b8-652d2b86d751" alt="Static website hosting"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. Leave every other thing as default and scroll down and click on &lt;strong&gt;save changes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fe739ef18-4c73-486d-85e6-df316bc4f338" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fe739ef18-4c73-486d-85e6-df316bc4f338" alt="save changes"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 4 - Attach a Bucket Policy
&lt;/h3&gt;

&lt;p&gt;i. Click on &lt;strong&gt;Permissions&lt;/strong&gt; tab and scroll down to &lt;strong&gt;Bucket policy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F638dddb4-1ee1-426b-bad2-6002a868b699" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F638dddb4-1ee1-426b-bad2-6002a868b699" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ii. Click on &lt;strong&gt;Edit&lt;/strong&gt; under &lt;strong&gt;Bucket policy&lt;/strong&gt; to input your bucket poilicy to allow access the website on the S3 bucket.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fd75c5092-6d0c-45a7-860e-86d1df4c6383" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fd75c5092-6d0c-45a7-860e-86d1df4c6383" alt="Bucket policy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. Attach the policy below and replace &lt;em&gt;bucket name&lt;/em&gt; with your bucket name. Scroll down and click on &lt;strong&gt;save changes&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::&amp;lt;bucket name&amp;gt;/*"
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fc4ef00f0-4d65-4b83-b34d-32fbba9d8e21" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fc4ef00f0-4d65-4b83-b34d-32fbba9d8e21" alt="policy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. Click on the &lt;strong&gt;Properties&lt;/strong&gt; tabs and scroll down to &lt;strong&gt;Static website hosting&lt;/strong&gt; and copy  the link there to open on your browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fe282912a-17af-4320-9d87-e1873e05bfb8" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fe282912a-17af-4320-9d87-e1873e05bfb8" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;v. When you open it if you everything right, you should see the static website here. This is what mine looks like.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.loom.com/share/752de16b21684e0aa3d04fbcbfa3a5d4?sid=3dacffd6-399b-4813-a268-e8d52a8bb145" rel="noopener noreferrer"&gt;https://www.loom.com/share/752de16b21684e0aa3d04fbcbfa3a5d4?sid=3dacffd6-399b-4813-a268-e8d52a8bb145&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Face028dc-8d5c-42c7-9cbd-3b42fd72de57" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Face028dc-8d5c-42c7-9cbd-3b42fd72de57" alt="wedding invite"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5 - Create a CloudFront Distribution to make your AWS S3 bucket private
&lt;/h3&gt;

&lt;p&gt;i.Search for &lt;strong&gt;Cloudfront&lt;/strong&gt; in your AWS console and click on it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F014b8f20-4a98-4a2b-b6f5-672ee978d5c0" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F014b8f20-4a98-4a2b-b6f5-672ee978d5c0" alt="cloudfront"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ii. Click on &lt;strong&gt;Create a CloudFront distribution&lt;/strong&gt; and populate it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F52c1afae-76b2-4f81-86d0-d8ab8ae9bcc5" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F52c1afae-76b2-4f81-86d0-d8ab8ae9bcc5" alt="CloudFront distribution"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. There is no existing Origin Access Control (OAC) so we need to create one. Click on &lt;strong&gt;Create new OAC&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F9c1b4c3e-5f61-4631-8dd0-cd3670131c63" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F9c1b4c3e-5f61-4631-8dd0-cd3670131c63" alt="Origin Access Control (OAC)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. Under &lt;strong&gt;Origin domain&lt;/strong&gt;, input the url you used in opening the your website which is found in your created  S3 bucket under &lt;strong&gt;Properties&lt;/strong&gt; &amp;gt;&amp;gt; &lt;strong&gt;Static website hosting&lt;/strong&gt;. If you see the &lt;strong&gt;use website endpoint&lt;/strong&gt; in yours, do not click on it. If you do,you will not see the &lt;strong&gt;Origin access control settings&lt;/strong&gt; which you need to set to make your bucket private.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F6c543aa3-47b0-4fbc-a8b9-87f198ffd494" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F6c543aa3-47b0-4fbc-a8b9-87f198ffd494" alt="Origin domain"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. You should get a page like this. Leave everything as default especially the &lt;strong&gt;origin type&lt;/strong&gt; as S3. Then click &lt;strong&gt;create&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F1049aa08-440f-461d-900f-1e5b0cec5259" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2F1049aa08-440f-461d-900f-1e5b0cec5259" alt="s3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;v. Under &lt;strong&gt;Web Application Firewall (WAF)&lt;/strong&gt;, click on the radio button &lt;strong&gt;Do not enable security protections&lt;/strong&gt;. We just want to keep it simple.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fcf075dc4-168d-4294-9016-f5911d7be1e6" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fcf075dc4-168d-4294-9016-f5911d7be1e6" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;vi Leave everything as default and click &lt;strong&gt;create distribution&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Febce8f5f-f104-4c06-9f5d-4778b737007f" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Febce8f5f-f104-4c06-9f5d-4778b737007f" alt="create distribution"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;vii. Click on &lt;strong&gt;create policy&lt;/strong&gt; and click on the circled url to paste the policy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fc953f8b3-aeb3-494d-b05a-9d4ff89b004d" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fc953f8b3-aeb3-494d-b05a-9d4ff89b004d" alt="create policy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;viii. Navigate to &lt;strong&gt;permissions&lt;/strong&gt; under your bucket and scroll to &lt;strong&gt;bucket policy&lt;/strong&gt; and click &lt;strong&gt;edit&lt;/strong&gt;. Delete the policy you pasted before which you used to see if your bucket was publicy accessible before we used cloudfront to make it private.Paste the copied policy in here. Scroll down and click on &lt;strong&gt;save changes&lt;/strong&gt;. The policy can be found below also.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
        "Version": "2008-10-17",
        "Id": "PolicyForCloudFrontPrivateContent",
        "Statement": [
            {
                "Sid": "AllowCloudFrontServicePrincipal",
                "Effect": "Allow",
                "Principal": {
                    "Service": "cloudfront.amazonaws.com"
                },
                "Action": "s3:GetObject",
                "Resource": "arn:aws:s3:::my-wedding-invitation/*",
                "Condition": {
                    "StringEquals": {
                      "AWS:SourceArn": "arn:aws:cloudfront::154334184944:distribution/E22OCAT2YCY14Z"
                    }
                }
            }
        ]
      }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fdbd33f6c-a2c1-44ba-bd05-901f6f075047" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fdbd33f6c-a2c1-44ba-bd05-901f6f075047" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ix. Navigate back to your cloudfront tab and copy the &lt;strong&gt;Distribution domain name&lt;/strong&gt;. Paste it on your browser and add /index.html to it. i.e &lt;a href="https://d3fvr8swd8au27.cloudfront.net/index.html" rel="noopener noreferrer"&gt;https://d3fvr8swd8au27.cloudfront.net/index.html&lt;/a&gt; Make sure to use your own &lt;strong&gt;Distribution domain name&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Faec88bdb-eb61-4507-b376-e522dbc842b7" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Faec88bdb-eb61-4507-b376-e522dbc842b7" alt="Distribution domain name"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;x. It would bring out your website page for you just like mine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fa694df26-16a8-451c-a3f7-48e7ae4b83f1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FAdaeze-69%2FHosting-a-Static-Website-with-CloudFront-and-AWS-S3%2Fassets%2F66219475%2Fa694df26-16a8-451c-a3f7-48e7ae4b83f1" alt="website"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Based on the steps we have taken to achieve this, it can be implied that the tutorial describes how to set up a private static website with Amazon S3 and CloudFront. Enabling static website hosting with a public read policy and setting up an S3 bucket to store website files are among the procedures. For global access, fast transfer rates and minimal latency are therefore guaranteed by creating a CloudFront distribution for content delivery.&lt;/p&gt;

&lt;p&gt;For the CloudFront distribution to control access to the S3 bucket, establishing an Origin Access Control (OAC) is an essential step in the procedure. To further make the S3 bucket private, the guide outlines how to remove the existing public read policy and change the bucket policy to limit access to only the CloudFront service.&lt;/p&gt;

&lt;p&gt;The documentation concludes by showing you how to use CloudFront to enhance the security and performance of your static website hosted on S3, all the while keeping it private and only available via the CloudFront distribution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;PS: Please remember to disable and then delete your Cloudfront and also empty and delete your AWS S3 bucket so you avoid incurring costs.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>cloudfront</category>
      <category>aws</category>
      <category>s3bucket</category>
      <category>staticwebsite</category>
    </item>
    <item>
      <title>Step-by-Step Guide: Setting Up Azure Entra ID with Domain Names and User Management</title>
      <dc:creator>Adaeze Nnamdi-Udekwe</dc:creator>
      <pubDate>Mon, 06 May 2024 14:06:41 +0000</pubDate>
      <link>https://dev.to/clouddiadem/step-by-step-guide-setting-up-azure-entra-id-with-domain-names-and-user-management-3dno</link>
      <guid>https://dev.to/clouddiadem/step-by-step-guide-setting-up-azure-entra-id-with-domain-names-and-user-management-3dno</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;What is Azure Entra ID?&lt;/p&gt;

&lt;p&gt;Originally known as Azure Active Directory (Azure AD), Azure Entra ID is a cloud-based identity and access management service provided by Microsoft. Controlling user identities and granting access to cloud-based resources, services, and apps is made efficient and secure with its help. To help businesses enhance security and expedite user management in both on-premises and cloud environments, Azure Entra ID enables role-based access control, multifactor authentication, and single sign-on (SSO).&lt;/p&gt;

&lt;p&gt;Now that we know what an Entra ID is, let's set up one!&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://azure.microsoft.com/en-us/pricing/purchase-options/azure-account" rel="noopener noreferrer"&gt;Azure portal&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id" rel="noopener noreferrer"&gt;Azure Entra ID&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.namecheap.com/" rel="noopener noreferrer"&gt;Domain name&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Credit card for billing(if you're opening the  azure portal account for the first time)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h3&gt;
  
  
  Step 1: Create a Domain Name
&lt;/h3&gt;

&lt;p&gt;i. Create a domain name with a domain name provider. Something simple and cheap. Below is my domain name which I created with &lt;a href="https://www.namecheap.com/" rel="noopener noreferrer"&gt;Namecheap&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fz4odqhaxsp1ktiz3vzri.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fz4odqhaxsp1ktiz3vzri.png" alt="my domain name"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Create an Email Address.
&lt;/h3&gt;

&lt;p&gt;i. Create an email address for the purpose of this task especially if you have created an Azure portal before or not. A hotmail, outlook or gmail will do. For the purpose of this task, I created a new hotmail account,so you can do the same.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Create an Azure Cloud Account.
&lt;/h3&gt;

&lt;p&gt;i. Create an Azure cloud account with this &lt;a href="//portal.azure.com"&gt; link&lt;/a&gt;  . You can get free 200 credits if you are creating the azure account for the first time else you will have to use the pay-as-you-go model to set up your subscription.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Create a DNS Zone
&lt;/h3&gt;

&lt;p&gt;i. In the Azure portal you just created, search for &lt;strong&gt;DNS Zone&lt;/strong&gt;, and click on &lt;strong&gt;create&lt;/strong&gt; or &lt;strong&gt;create DNS zone&lt;/strong&gt;. Anyone will work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F9ufkuaus6vg8sd15dgr3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9ufkuaus6vg8sd15dgr3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A DNS zone is a resource that contains the DNS records for a specific domain, allowing you to manage the domain's DNS settings such as IP addresses and mail exchange servers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;ii. Under &lt;strong&gt;Project details&lt;/strong&gt;, in &lt;strong&gt;Subscription&lt;/strong&gt;, pick the subscription that is there by default. In &lt;strong&gt;Resource group&lt;/strong&gt;, click on &lt;strong&gt;create new&lt;/strong&gt; and put a name of your choice.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Instance details&lt;/strong&gt;, in &lt;strong&gt;Name&lt;/strong&gt;, put your domain name which you created in step 1. In &lt;strong&gt;resource group location&lt;/strong&gt; I picked Canada East. Then click &lt;strong&gt;review create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fekqn6f1k006hnb4r23xg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fekqn6f1k006hnb4r23xg.png" alt="naming"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. You should see a page like this if you do everything properly. Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fq38h7lgcaobl86eyjup3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fq38h7lgcaobl86eyjup3.png" alt="DNS Zone created"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. You should see the image below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fc63g2qxx14b4gs4o09on.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fc63g2qxx14b4gs4o09on.png" alt="deployment"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;v. Click on &lt;strong&gt;go to resources&lt;/strong&gt; and see your DNS servers. I circled it for you to see.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fur4xq67wlcxq53n3j1ts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fur4xq67wlcxq53n3j1ts.png" alt="DNS Servers"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Configure Nameservers on NameCheap
&lt;/h3&gt;

&lt;p&gt;i. If you used namecheap domain provider, then navigate to the &lt;strong&gt;Domain List&lt;/strong&gt; at your left, and click on manage by your right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fnrefnllr0g1vukxs6p5t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fnrefnllr0g1vukxs6p5t.png" alt="navigation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ii. Scroll down and you will see the nameservers section. Click the dropdown circled and pick Custom DNS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fvhte6pgf0tytc189maeg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fvhte6pgf0tytc189maeg.png" alt="custom dns"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. From &lt;em&gt;step 4, number v&lt;/em&gt;, copy all the nameservers circled and paste them on the namecheap nameserver lines, and press the green tick just above it to have them all saved.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fv1asesyqh618niyke3bt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fv1asesyqh618niyke3bt.png" alt="namesever"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Create a Custom Domain
&lt;/h3&gt;

&lt;p&gt;i.  On a new tab, open the Entra ID &lt;a href="https://entra.microsoft.com/#home" rel="noopener noreferrer"&gt;link&lt;/a&gt;. Still, leave the Azure portal tab open as we will need it later.&lt;/p&gt;

&lt;p&gt;ii. In the Entra ID, on the left side, navigate to identity &amp;gt;&amp;gt; settings &amp;gt;&amp;gt; domain names. Click on &lt;strong&gt;Add custom domain&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fkyho7n7pw7gqz3z6avfe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fkyho7n7pw7gqz3z6avfe.png" alt="Add custom domain"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. Add the domain name you created in this project and click &lt;strong&gt;Add domain&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F8z4qc2umc188malzrodv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F8z4qc2umc188malzrodv.png" alt="domain name"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. Click on verify just below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fepb9jhbbxvfk7n5aiety.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fepb9jhbbxvfk7n5aiety.png" alt="verify"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. Back to your Azure portal, click on &lt;strong&gt;Record set&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;v. Copy the '@' in the &lt;strong&gt;Alias or hostname&lt;/strong&gt; from the Entra ID tab and paste it in the Azure portal tab's &lt;strong&gt;Add record set&lt;/strong&gt; name section.&lt;/p&gt;

&lt;p&gt;vi. From the Enrta ID, the record type is 'TXT', pick it from the drop-down in the Azure portal.&lt;/p&gt;

&lt;p&gt;v. The TTL in the Entra ID is 3600 seconds which is equivalent to 1 hour so pick 1 hour in the Azure portal.&lt;/p&gt;

&lt;p&gt;vi. Copy the value under the &lt;strong&gt;Destination or points to address&lt;/strong&gt; in Entra ID and paste it under &lt;strong&gt;value&lt;/strong&gt; in the Azure portal. Click &lt;strong&gt;OK&lt;/strong&gt; to create the record set.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fz9zbpxbrimntis4u6i4i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fz9zbpxbrimntis4u6i4i.png" alt="record set"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;vii. You will see the record created just like the one below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fo0h9dt3aorav2iaqab95.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fo0h9dt3aorav2iaqab95.png" alt="created record"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;viii. Go back to the Entra ID tab, and navigate to the &lt;strong&gt;custom domain names&lt;/strong&gt;. We want to make our custom domain we created the primary domain. It is presently not the custom domain as the default one given to us by Azure is the primary domain.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fgby2deoke0kpfgbvtr8k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fgby2deoke0kpfgbvtr8k.png" alt="primary domain"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ix. Click on your domain name and tick the place that says &lt;strong&gt;make primary&lt;/strong&gt;. Whatever prompt you see, click 'Yes'. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fcmpci66is59vfk00xa0z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fcmpci66is59vfk00xa0z.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;x. If you go back to your custom domain and refresh the page, you will see that your custom domain is now the primary domain.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Frxehafaw8um76oc9i1qg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Frxehafaw8um76oc9i1qg.png" alt="primary domain"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 7: Create single and bulk Users in Entra ID
&lt;/h3&gt;

&lt;p&gt;i. Navigate to identity &amp;gt;&amp;gt; Users &amp;gt;&amp;gt; all users, click on &lt;strong&gt;create user&lt;/strong&gt; drop down, and then click on &lt;strong&gt;create new user&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F8hnpx381iz3vlo649th3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F8hnpx381iz3vlo649th3.png" alt="create user"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ii. input a name you want in the &lt;strong&gt;User principal name&lt;/strong&gt; and &lt;strong&gt;display name&lt;/strong&gt; . You can use the &lt;strong&gt;auto-generate password&lt;/strong&gt; or you untick it and create your own. Click &lt;strong&gt;Review + Create&lt;/strong&gt; and then click on &lt;strong&gt;create&lt;/strong&gt;. Refresh your page and you will see your newly created user.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fah1fnxemn446ermyh6a7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fah1fnxemn446ermyh6a7.png" alt="user creation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. To create the bulk users using the company's domain name, click on &lt;strong&gt;bulk operations&lt;/strong&gt; dropdown and click &lt;strong&gt;bulk create&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;iv. Click on 'download' and download the spreadsheet and populate it with data &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F9fv50q8mo10boiqarp93.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9fv50q8mo10boiqarp93.png" alt="demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;v. It should look like what is below. Under the user name, let the names after the '@' be your domain name. Populate everything with names of your choice and then download the spreadsheet as a CSV file. The passwords can be changed by the users after they use their credentials to log in. They do not need to own the same passwords afterwards.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fwwesfxvkrot7673l7eii.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fwwesfxvkrot7673l7eii.png" alt="spread sheet"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;vi. Go back to the Entra ID page and then upload the downloaded file and then click submit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fgtk4inabfa2mgysyorti.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fgtk4inabfa2mgysyorti.png" alt="upload"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;v. Refresh the page and you will see all the users from the uploaded spreadsheet just like mine below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fwwprzdei8ct84m5zsfbp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fwwprzdei8ct84m5zsfbp.png" alt="users data"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 8: Assigning Roles and Groups.
&lt;/h3&gt;

&lt;p&gt;i. Click on any user of your choice you want to assign a role to. We will be assigning an administrative (admin) role in this project. After clicking on any of the users, click on &lt;strong&gt;assigned roles&lt;/strong&gt; and then &lt;strong&gt;add assignments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1r8psh9fv6fieyf5x0e5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1r8psh9fv6fieyf5x0e5.png" alt="role assignment"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ii. Assign global administrator if you want the person to be in charge of the azure account and give an account of all that happens in it. It is not a role to assign to anyone anyhow. You can read the permissions the person has that I highlighted. Then go ahead and click &lt;strong&gt;add&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F7cmtchatjgwh8ksepts3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F7cmtchatjgwh8ksepts3.png" alt="global admin"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iii. Click on audit logs to see a list of activities happening in the administrative user's account. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fc09zwpzz77u1h5e1nku9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fc09zwpzz77u1h5e1nku9.png" alt="audit log"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;iv. Go back to your users and then on the left side, navigate to identity &amp;gt;&amp;gt; groups &amp;gt;&amp;gt; All groups and then click on &lt;strong&gt;new group&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fkzdxd78eayz4b5wlmaov.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fkzdxd78eayz4b5wlmaov.png" alt="group creation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;v. Populate the spaces with what you want like I did mine below. Click on &lt;strong&gt;No owners selected&lt;/strong&gt; and pick user of your choice and &lt;strong&gt;No members selected&lt;/strong&gt; and select users to be members in that group. For the &lt;strong&gt;No owners selected&lt;/strong&gt;, you are selecting who will be in charge of the group you've created. Click &lt;strong&gt;create&lt;/strong&gt;. Refresh your page and you will see the group you created. Click on it and see an overview of all you did.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fzdv6zcdzb85p23zehos4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fzdv6zcdzb85p23zehos4.png" alt="populate"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;vi. This is what yours should look like when you are done creating the group and assigning owner and members to the group. Click on the group created. I have a total of 6 members and one owner. I added the owner as a member so they can have member privileges too.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fgyl0fk33crpwsjpujght.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fgyl0fk33crpwsjpujght.png" alt="group creation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;To sum this up, this tutorial offered a comprehensive method for configuring and overseeing Azure Entra ID, encompassing the creation of domain names, email addresses, and DNS zones, in addition to setting up custom domains and handling users, roles, and groups. You can set up a safe and effective identity management system for your cloud environment by following these steps. With Azure Entra ID, you can improve security and streamline user management for both on-premises and cloud services.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Automation of LAMP (Linux, Apache, MySQL, PHP) stack deployment using Bash Script in Ansible</title>
      <dc:creator>Adaeze Nnamdi-Udekwe</dc:creator>
      <pubDate>Sat, 27 Apr 2024 16:30:30 +0000</pubDate>
      <link>https://dev.to/clouddiadem/automation-of-lamp-linux-apache-mysql-php-stack-deployment-using-a-bash-script-in-ansible-2bd8</link>
      <guid>https://dev.to/clouddiadem/automation-of-lamp-linux-apache-mysql-php-stack-deployment-using-a-bash-script-in-ansible-2bd8</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;A Bash Script is a text file with several commands written in the Bash shell language. The Bash shell carries out operations one by one when you run the script. This allows you to automate repetitive tasks, manage files, and configure systems.&lt;/p&gt;

&lt;p&gt;Ansible is an open-source automation tool for configuration and&lt;br&gt;
management of IT infrastructures. It allows for the easy&lt;br&gt;
management of numerous servers using YAML language to describe&lt;br&gt;
automated tasks. Ansible operates agentlessly, meaning there is no&lt;br&gt;
need to install additional software on the nodes it manages.&lt;/p&gt;



&lt;p&gt;You will appreciate the use of Ansible as a tool if you find out about things it does to make your IT job easy. Here are some advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ease of use and simplicity: YAML is a human-readable language used to write playbooks (configuration files).&lt;/li&gt;
&lt;li&gt;Strong and adaptable: Ansible is capable of managing challenging jobs and changing with the times.&lt;/li&gt;
&lt;li&gt;Agentless: Management and security are made simpler by not requiring software to be installed on the controlled nodes.&lt;/li&gt;
&lt;li&gt;Idempotent: Playbooks can be run repeatedly without producing unpleasant or unexpected results.&lt;/li&gt;
&lt;li&gt;Huge support and community: Ansible has a large and active community, as well as a wealth of modules and resources.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Context
&lt;/h2&gt;

&lt;p&gt;Just so we understand what we are going to be doing in this project, I will explain all that it entails.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We are going to automate the provisioning of two Ubuntu-based servers, named “master” and “slave”, using Vagrant. &lt;/li&gt;
&lt;li&gt;On the Master node, we will create a bash script to automate the deployment of a LAMP (Linux, Apache, MySQL, PHP) stack.&lt;/li&gt;
&lt;li&gt;The bash script we create above should clone a PHP application from &lt;a href="https://github.com/laravel/laravel" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, install all necessary packages, and configure Apache web server and MySQL.&lt;/li&gt;
&lt;li&gt;We will ensure the bash script is reusable and readable.&lt;/li&gt;
&lt;li&gt;Using Ansible Playbook, we will execute the bash script on the Slave node and verify that the PHP application is accessible through the Virtual Machine’s IP address.&lt;/li&gt;
&lt;li&gt;We will also create a cron job to check the server’s uptime every 12 am.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Setting Up Virtual Machines
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;To create a Virtual Machine, Check these resources for &lt;a href="https://ubuntu.com/tutorials/how-to-run-ubuntu-desktop-on-a-virtual-machine-using-virtualbox#1-overview" rel="noopener noreferrer"&gt;Ubuntu&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You should have a Vagrantfile for the Virtual Machines saved in your local file folder just like mine below after you start your machine. But if you don't I can walk you through it. Remember you need to create 2 Ubuntu servers named "master" and "slave". Open your Virtual box down as you will need it open to start your Virtual Machines. Create two folders and name them "master" and "slave".&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frkxmjnhwvvao9v7wq8ap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frkxmjnhwvvao9v7wq8ap.png" alt="folders" width="577" height="49"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the folders with Gitbash. Let us start with the "master" folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0tqcrc4j5liiwrg03m8a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0tqcrc4j5liiwrg03m8a.png" alt="gitbash" width="444" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next is to Initialize your master Ubuntu machine. After opening the "master" folder with git bash, run:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vagrant init Ubuntu/focal64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19r7n91tj69yvikga1iz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19r7n91tj69yvikga1iz.png" alt="vagrant init master" width="519" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the &lt;code&gt;Vagrantfile&lt;/code&gt; and make some edits to the configuration file using the command &lt;code&gt;nano vagrantfile&lt;/code&gt;. It would help if you had something like this.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyfor67itsif16ys07y9v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyfor67itsif16ys07y9v.png" alt="vagrantfile" width="669" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go ahead to paste the configuration below just under &lt;code&gt;Vagrant.configure("2") do |config|&lt;/code&gt; like the image below. Also, add &lt;code&gt;config.ssh.insert_key = false&lt;/code&gt; under &lt;code&gt;config.vm.box = ubuntu/focal64&lt;/code&gt;. Press "crtl+O" to save, then "enter" and "ctrl+x" to exit the vagrantfile.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Provision master Node
config.vm.define "master" do |master|
master.vm.box = "ubuntu/focal64"
master.vm.hostname = "master"
master.vm.network "private_network", ip: "192.168.33.10", type: "dhcp"
end

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;NOTE: I have circled the aspects you should the various commands under. Pay attention to them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftw2jry0v1pw6xzvux13o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftw2jry0v1pw6xzvux13o.png" alt="vagrantfile" width="628" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then run the following command to start the machine. It would be best if you had something like the image below towards the end after running the command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vagrant up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frob6te8xu2l6649o5d0t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frob6te8xu2l6649o5d0t.png" alt="vagrant up master" width="644" height="130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connect the virtual machine by running:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vagrant ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcch48p1ullz2xc80r16k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcch48p1ullz2xc80r16k.png" alt="vagrant ssh" width="577" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now that you have logged into your "masters" virtual machine, follow the same procedure for the "slave" virtual machine. You should have something like the screenshot below by the time you ssh into your "slave" virtual machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqgy620qc9b38l2xcxfao.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqgy620qc9b38l2xcxfao.png" alt="slave machine" width="699" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;NOTE: Every other thing is the same for the procedure except for the configuration in the vagrant file which should be under &lt;code&gt;Vagrant.configure("2") do |config|&lt;/code&gt;. Use the command below under the &lt;code&gt;Vagrant.configure("2") do |config|&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Provision Slave Node
config.vm.define "slave" do |slave|
slave.vm.box = "ubuntu/focal64"
slave.vm.hostname = "slave"
slave.vm.network "private_network", ip: "192.168.33.11", type: "dhcp"
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Connect the "master" and "slave" machine by _ssh-ing _into each of them
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use the command &lt;code&gt;ip a&lt;/code&gt; to check for the IP address of each of the virtual machines. Below is that of the "master's" virtual machine. The circled one is the IP address for the "master" virtual machine. Do the same for the "slave" virtual machine. I have underlined each one for you to know what virtual machine owns each IP address. Also, note that your IP address will be different from mine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffmvqj5sl1nlq1p6uqpne.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffmvqj5sl1nlq1p6uqpne.png" alt="IP address for master" width="688" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgpz6zl0hlqhqlaj8ilyf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgpz6zl0hlqhqlaj8ilyf.png" alt="IP address for slave" width="750" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On your "master" Virtual Machine, write &lt;code&gt;ssh-keygen&lt;/code&gt; to generate a private &amp;amp; public key. When you run the command you will see 
&lt;code&gt;Enter file in which to save the key (/home/vagrant/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:&lt;/code&gt;
Keep pressing the "enter" key when those 3 lines appear as seen below.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1sy4xf095bedmeiu0i6l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1sy4xf095bedmeiu0i6l.png" alt="master key" width="547" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We will repeat the above step for the "slave" virtual machine too and should look like what is below.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbsdu0x6jghqwpri6b4e1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbsdu0x6jghqwpri6b4e1.png" alt="slave key" width="588" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the "master" virtual machine, change the directory into ssh with the command &lt;code&gt;cd .ssh&lt;/code&gt; and then &lt;code&gt;ls&lt;/code&gt; to list all the files in the ssh directory. You will see something like what is below.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fazsemm3tqm0kriyh3jhg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fazsemm3tqm0kriyh3jhg.png" alt="cd .ssh" width="500" height="66"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the content of  id_rsa.pub and copy it to save it somewhere for later use. That is where your public key is and that is what you are copying. Use this command to open it &lt;code&gt;cat id_rsa.pub&lt;/code&gt;. The key would be long and look like something below.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzga3e9pjjvv8wx1vbyo0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzga3e9pjjvv8wx1vbyo0.png" alt="public key" width="800" height="137"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Change the directory to .ssh with the command cd .ssh just as we did in the "master" virtual machine. Create and open a file in the .ssh directory of the "slave" machine at once so that the public key you copied from the "masters" machine and saved somewhere, you will paste it in the created file. I named my file 'public'. Run the command nano public and paste the public key from the "master" virtual machine here. After pasting all the public keys correctly, press 'crtl+O' to save, press 'enter', and then press 'ctrl+X' to exit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then run the command &lt;code&gt;cat public &amp;gt;&amp;gt; authorized_keys&lt;/code&gt; to copy the public keys into the authorized_keys file from the file named public in the "slave" machine. Run the command &lt;code&gt;cat authorized_keys&lt;/code&gt; to see the content of the copied public keys of the "masters" virtual machine and the "slave" virtual machine. Below is an image of both the "masters" and "slave" public keys.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1k2xwo345aagpgn040yn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1k2xwo345aagpgn040yn.png" alt="public keys" width="708" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connect the "master" virtual machine to the "slave" virtual machine by using ssh to connect the IP address of the "slave" machine to the "master" machine. First of all, run the command &lt;code&gt;ip a&lt;/code&gt; to know the IP addresses in each machine. Then run the command ssh vagrant@slave ip in the "master" virtual machine. It should look like this &lt;code&gt;ssh vagrant@192.168.33.9&lt;/code&gt; Make sure to replace the IP address with your own "slave" IP address. 
Whatever it prompts you, type 'yes'. From the screenshot, you can see that we can connect to our "slave" machine from the "master" machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh313l3hb5mt19cnvql61.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh313l3hb5mt19cnvql61.png" alt="master sshing into slave" width="498" height="432"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Creating the Bash Script and Ansible to automate the provisioning of the two Ubuntu-based Virtual Machines we've created.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In your "master" virtual machine, create your script that will automate the deployment of LAMP (Linux, Apache, MySQL, PHP) stack.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Name your script anything of your choice with the .sh extension. I will be naming mine LAMP.sh. Use the command &lt;code&gt;touch LAMP.sh&lt;/code&gt; to create your script. run &lt;code&gt;ls&lt;/code&gt; to see if the script file you ran is showing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe8ybz9t94pauwzz8h2vy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe8ybz9t94pauwzz8h2vy.png" alt="create script" width="559" height="63"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run &lt;code&gt;nano LAMP.sh&lt;/code&gt; to open the file script and write your script. Please copy and paste this script inside it. Each line of the command has a comment with a brief explanation with a '#' symbol in front of it. I made sure to pick each line of commands one by one to run before compiling it into a full script below.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

# Define variables for paths and IP address
LARAVEL_DIR="/var/www/html/laravel"
LARAVEL_CONF="/etc/apache2/sites-available/laravel.conf"
VIRTUAL_HOST="192.168.33.9"

# Update all package index and upgrade packages
sudo apt update
sudo apt upgrade -y
echo "Done with upgrade package"

# Update the PHP repository
sudo add-apt-repository -y ppa:ondrej/php
echo "Done with php repo update"

# Install Apache
sudo apt install -y apache2
sudo systemctl enable apache2
echo "Done with Apache installation"

# Install MySQL
sudo debconf-set-selections &amp;lt;&amp;lt;&amp;lt; 'mysql-server mysql-server/root_password password'
sudo debconf-set-selections &amp;lt;&amp;lt;&amp;lt; 'mysql-server mysql-server/root_password_again password'
sudo apt install -y mysql-server
echo "Done with MySQL installation"

# Install PHP 8.2 and 8.3 with necessary extensions
sudo apt install -y php libapache2-mod-php php-mysql php8.2 php8.2-curl php8.2-dom php8.2-xml php8.2-mysql php8.2-sqlite3 php8.3 php8.3-curl php8.3-dom php8.3-xml php8.3-mysql php8.3-sqlite3
echo "Done with PHP 8.2 and 8.3 installation"

# Run MySQL secure installation
expect &amp;lt;&amp;lt;EOF
spawn sudo mysql_secure_installation
expect "Would you like to setup VALIDATE PASSWORD component?"
send "y\r"
expect {
    "Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG" {
        send "1\r"
        exp_continue
    }
    "Remove anonymous users?" {
        send "y\r"
        exp_continue
    }
    "Disallow root login remotely?" {
        send "n\r"
        exp_continue
    }
    "Remove test database and access to it?" {
        send "y\r"
        exp_continue
    }
    "Reload privilege tables now?" {
        send "y\r"
        exp_continue
    }
}
EOF
echo "Done with MySQL secure installation"

# Restart Apache
sudo systemctl restart apache2
echo "Done with Apache restart"

# Install Git
sudo apt install -y git
echo "Done with Git installation"

# Clone Laravel repository
sudo git clone https://github.com/laravel/laravel $LARAVEL_DIR
echo "Done with cloning Laravel repository"

# Change directory to Laravel folder
cd $LARAVEL_DIR
echo "Changed directory to $LARAVEL_DIR"

# Install Composer
sudo apt install -y composer
echo "Done with installing Composer"

# Upgrade Composer to version 2
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php --install-dir /usr/bin --filename composer
echo "Done with upgrading Composer to version 2"

# Use Composer to install dependencies
yes | sudo composer install
echo "Done installing Composer dependencies"

# Copy Laravel configuration file and set permissions
sudo cp .env.example .env
sudo chown www-data:www-data .env
sudo chmod 640 .env
echo "Done copying Laravel configuration file and setting permissions"

# Create virtual host in /etc/apache2/sites-available
sudo tee $LARAVEL_CONF &amp;gt;/dev/null &amp;lt;&amp;lt;EOF
&amp;lt;VirtualHost *:80&amp;gt;
    ServerName $VIRTUAL_HOST
    ServerAlias *
    DocumentRoot $LARAVEL_DIR/public

    &amp;lt;Directory $LARAVEL_DIR&amp;gt;
        AllowOverride All
    &amp;lt;/Directory&amp;gt;
&amp;lt;/VirtualHost&amp;gt;
EOF
echo "Done creating virtual host in /etc/apache2"

# Generate application key
sudo php artisan key:generate
echo "Done generating application key"

# Run migrations
sudo php artisan migrate --force
echo "Done running migrations"

# Change ownership permissions
sudo chown -R www-data:www-data $LARAVEL_DIR/database/ $LARAVEL_DIR/storage/logs/ $LARAVEL_DIR/storage $LARAVEL_DIR/bootstrap/cache
echo "Done changing ownership permissions"

# Set file permissions
sudo chmod -R 775 $LARAVEL_DIR/database/ $LARAVEL_DIR/storage/logs/ $LARAVEL_DIR/storage
echo "Done setting file permissions"

# Disable default configuration file
sudo a2dissite 000-default.conf
echo "Done disabling default configuration file"

# Enable Laravel configuration file
sudo a2ensite laravel.conf
echo "Done enabling Laravel configuration file"

# Restart Apache
sudo systemctl restart apache2
echo "Done restarting Apache"


uptime &amp;gt; /var/log/uptime.log

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Press 'crtl+O' to save, press 'enter' and then 'crtl+X' to exit the script.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;The variables created in the first three lines of the script allow for its reusability, as mentioned in our context.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Leave the repository as it is in the script, as it is the same one linked earlier in this article.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here is a snippet of my script&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx55f9lok6zcl0jm6aruj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx55f9lok6zcl0jm6aruj.png" alt="script" width="744" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Below are detailed explanations of what each line of command does:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;i. Defining variables for paths and IP address:&lt;/p&gt;

&lt;p&gt;-LARAVEL_DIR="/var/www/html/laravel": This variable specifies the directory where the Laravel application will be located.&lt;/p&gt;

&lt;p&gt;-LARAVEL_CONF="/etc/apache2/sites-available/laravel.conf": This variable specifies the path for the Apache virtual host configuration file for Laravel.&lt;/p&gt;

&lt;p&gt;-VIRTUAL_HOST="192.168.33.9": This variable specifies the IP address for the virtual host.&lt;br&gt;
ii. Updating package index and upgrading packages:&lt;/p&gt;

&lt;p&gt;-sudo apt update: Updates the list of available packages and their versions.&lt;br&gt;
-sudo apt upgrade -y: Upgrades all installed packages to the latest versions. The -y option automatically answers "yes" to prompts.&lt;br&gt;
iii. Updating the PHP repository:&lt;/p&gt;

&lt;p&gt;-sudo add-apt-repository -y ppa:ondrej/php: Adds the PHP PPA (Personal Package Archive) maintained by Ondřej Surý, which provides the latest PHP versions.&lt;/p&gt;

&lt;p&gt;iv. Installing Apache:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo apt install -y apache2: Installs the Apache web server.&lt;/li&gt;
&lt;li&gt;sudo systemctl enable apache2: Enables Apache to start automatically on system boot.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;v. Installing MySQL:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo debconf-set-selections &amp;lt;&amp;lt;&amp;lt; 'mysql-server mysql-server/root_password password': Configures the root password for MySQL server installation.&lt;/li&gt;
&lt;li&gt;sudo apt install -y mysql-server: Installs the MySQL server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;vi. Installing PHP 8.2 and 8.3 with necessary extensions:&lt;/p&gt;

&lt;p&gt;sudo apt install -y php libapache2-mod-php php-mysql php8.2 ...: Installs PHP 8.2 and 8.3 with necessary extensions such as curl, dom, xml, mysql, and sqlite3.&lt;/p&gt;

&lt;p&gt;vii. Running MySQL secure installation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The expect block automates the mysql_secure_installation process, answering prompts automatically to set up MySQL securely.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;viii. Restarting Apache:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo systemctl restart apache2: Restarts the Apache web server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ix. Installing Git:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo apt install -y git: Installs Git, a version control system.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;x. Cloning Laravel repository:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo git clone &lt;a href="https://github.com/laravel/laravel" rel="noopener noreferrer"&gt;https://github.com/laravel/laravel&lt;/a&gt; $LARAVEL_DIR: Clones the Laravel repository from GitHub to the specified directory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xi. Changing directory to Laravel folder:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cd $LARAVEL_DIR: Changes the current working directory to the Laravel folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xii. Installing Composer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo apt install -y composer: Installs Composer, a dependency management tool for PHP.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xiii. Upgrading Composer to version 2:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;These commands download and verify the Composer installer, then install Composer version 2.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xiv. Installing Composer dependencies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;yes | sudo composer install: Installs Composer dependencies for the Laravel project, automatically answering "yes" to prompts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xv. Copying Laravel configuration file and setting permissions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copies the Laravel .env.example configuration file to .env and sets appropriate ownership and permissions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xvi. Creating virtual host in /etc/apache2/sites-available:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo tee $LARAVEL_CONF &amp;gt;/dev/null &amp;lt;&amp;lt;EOF: Creates a new virtual host configuration file for Laravel.&lt;/li&gt;
&lt;li&gt;This block of code sets up the virtual host with the specified server name, alias, and document root.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xvii. Generating application key:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo php artisan key:generate: Generates a unique application key for the Laravel project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xviii. Running migrations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo php artisan migrate --force: Runs database migrations for the Laravel project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xix. Changing ownership permissions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo chown -R www-data:www-data $LARAVEL_DIR/...: Changes ownership of specified directories to the www-data user and group.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xx. Setting file permissions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo chmod -R 775 $LARAVEL_DIR/...: Sets file permissions to 775 (read, write, execute for owner and group; read and execute for others).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xxi. Disabling default configuration file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo a2dissite 000-default.conf: Disables the default Apache configuration file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xxii. Enabling Laravel configuration file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudo a2ensite laravel.conf: Enables the Laravel virtual host configuration file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;xxiii. Restarting Apache:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;sudo systemctl restart apache2: Restarts the Apache web server to apply changes.&lt;br&gt;
xxiv. Logging system uptime:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;uptime &amp;gt; /var/log/uptime.log: Records the current system uptime to a log file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test run the script to see if it works by running the command &lt;code&gt;./LAMP.sh&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;Still in your "master" machine create an Ansible directory with the command
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir Ansible
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Change into the &lt;code&gt;Ansible&lt;/code&gt; directory so it becomes your present working directory.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd Ansible
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run this command to update any dependencies. From the image below, you should have something like the image below at the end after the update.
&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-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnnkifk05rvmbwkg2r6ga.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnnkifk05rvmbwkg2r6ga.png" alt="apt-get update" width="724" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then to install Ansible run the command below. It would be best if you had something like the image at the end of the installation.
&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 install ansible
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4wbnt6dkvdyuwjkmqjv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4wbnt6dkvdyuwjkmqjv.png" alt="install ansibe" width="683" height="188"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;Still, in your &lt;code&gt;Ansible&lt;/code&gt; directory, create your inventory. The inventory file is used to store the address of the slave nodes to be configured which will enable the playbook to run in the "slave" machine even if it is created in the "master's" machine.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch inventory 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Open your inventory file to put in the IP address of your "slave" machine. It should look like the image below, but use your IP address. Press 'crtl+O' to save, press 'enter', and then 'crtl+X' to exit the text editor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjk303ss3mq1xca0ld0d9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjk303ss3mq1xca0ld0d9.png" alt="IP address" width="561" height="228"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;Create your playbook with the &lt;code&gt;.yml&lt;/code&gt; extension.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch playbook.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;To ping your inventory run the command in your "master" machine. It should look like the screenshot below. Press 'crtl+C' to cancel it afterwards.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ansible all -m ping -i inventory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh1phsxozii0eg0d78559.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh1phsxozii0eg0d78559.png" alt="pinging" width="800" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change the directory back to Ansible with the command &lt;code&gt;cd Ansible&lt;/code&gt;. Then open the playbook with the command &lt;code&gt;nano playbook.yml&lt;/code&gt;. Paste the command below inside your playbook but change the IP address to your "slave" machine IP. Press 'crtl+O' to save, press 'enter', and then 'crtl+X' to exit the playbook.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---

- hosts: slave
  become: yes
  tasks:

    # Copy LAMP.sh script to the slave node
    - name: Copy LAMP.sh script to slave node
      copy:
        src: /home/vagrant/Ansible/LAMP.sh
        dest: /home/vagrant/LAMP.sh
        mode: 0755  

      # Make the script executable

    # Execute the LAMP.sh script on the slave node
    - name: Execute LAMP.sh script on slave node
      shell: /home/vagrant/LAMP.sh


- name: Create a cron job to check server's uptime every 12 am
  hosts: slave
  become: yes
  tasks:

    # Create an uptime script that logs the server's uptime to a file
    - name: Create the uptime script
      copy:
        content: |

          #!/bin/bash

          # Log the server's uptime to a file
          uptime &amp;gt; /var/log/uptime.log
        dest: /usr/local/bin/check_uptime.sh
        mode: '0755'  # Make the script executable

    # Create a cron job that runs the uptime script every day at 12 am (midnight)

    - name: Create a cron job to check uptime every 12 am
      cron:
        name: Check uptime every 12 am
        job: "/usr/local/bin/check_uptime.sh"

        # Run at 12:00 am
        minute: '0'  
        hour: '0'
        state: present

    # Display the contents of the uptime log file
    - name: Display uptime log file
      shell: cat /var/log/uptime.log
      register: uptime_output

    # Display the server's uptime as captured in the uptime log file
    - name: Display the server's uptime
      debug:
        msg: "{{ uptime_output.stdout }}"

    # Task to fetch the content of the PHP application using curl
    - name: Fetch PHP application content using curl
      command: "curl -s http://192.168.33.9"  # Perform a silent HTTP GET request to the target IP address
      register: php_application  # Register the output of the curl command
      ignore_errors: true  # Continue playbook execution even if this task fails

    # Task to display the content fetched from the PHP application
    - name: Display content of PHP application
      debug:
        msg: "PHP Application Content:\n{{ php_application.stdout }}"  # Display the output of the curl command

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is a snippet of my playbook&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj5ez1lghozgynlva2zoq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj5ez1lghozgynlva2zoq.png" alt="playbook" width="800" height="543"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Created a cron job to check the server’s uptime every 12 am in my playbook. You can find the task in the playbook above but this is a snippet of it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0x7jyzz24mds1owbd9ra.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0x7jyzz24mds1owbd9ra.png" alt="cron job" width="545" height="120"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is the content of my log file where the server's uptime check is stored. Since my master and my slave are connected, I was able to check this from my "slave" machine. I used the command &lt;code&gt;sudo crontab -l&lt;/code&gt; to check.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd22mlshgk9kmz4wnb5eo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd22mlshgk9kmz4wnb5eo.png" alt="uptime check" width="693" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the command below to execute the playbook:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ansible-playbook playbook.yml -i inventory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;I could execute the bash script on the Slave node and verify that the PHP application is accessible through the VM’s IP address. I have circled the slave IP address in the screenshot.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi95wpr6ib4umtw00p57x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi95wpr6ib4umtw00p57x.png" alt="execution 1" width="748" height="386"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7qiwl6d60yk8l4ilvlms.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7qiwl6d60yk8l4ilvlms.png" alt="Execution 2" width="744" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste your "slave" IP address on your web browser. This is the output with the slave IP address. A Laravel PHP application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxsynxdlwkzk909g7hk67.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxsynxdlwkzk909g7hk67.png" alt="laravel page" width="745" height="367"&gt;&lt;/a&gt;&lt;/p&gt;




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

&lt;p&gt;In summary, one of the effective and dependable methods for provisioning and controlling servers has been demonstrated in this project by the automation of the LAMP (Linux, Apache, MySQL, PHP) stack deployment utilizing a Bash script in Ansible. The deployment of the LAMP stack on Ubuntu-based servers is quite fast and less labor-intensive than with manual setup because of the script automation and it is even reusable.&lt;/p&gt;

&lt;p&gt;The Bash script can be easily adapted to many environments and use cases due to its reusability, which is attained through defining variables that can be passed as parameters and error handling.&lt;/p&gt;

&lt;p&gt;The deployment process was further automated and made uniform and repeatable by integrating the script into an Ansible playbook. In addition to establishing cron jobs to track server uptime and confirming that PHP applications could be accessed, the playbook carried out actions on both the master and slave nodes, giving important information about server performance.&lt;/p&gt;

&lt;p&gt;Even though there were a few difficulties along the road, like script errors and log file problems, these could be fixed with thorough debugging and code modifications. The result showed that the PHP application was successfully deployed and verified on the slave node's IP address.&lt;/p&gt;

&lt;p&gt;All things considered, the project demonstrates how Ansible and Bash scripting can be used to automate intricate deployment procedures. This detailed documentation of the stages and solutions makes it useful for future deployments and projects utilizing the LAMP stack.&lt;/p&gt;

</description>
      <category>ansible</category>
      <category>lamp</category>
      <category>bashscript</category>
      <category>laravel</category>
    </item>
    <item>
      <title>Linux Commands (Trying Out Linux commands with Directories and Files)</title>
      <dc:creator>Adaeze Nnamdi-Udekwe</dc:creator>
      <pubDate>Sun, 24 Mar 2024 23:00:00 +0000</pubDate>
      <link>https://dev.to/clouddiadem/linux-commands-trying-out-linux-commands-with-directories-and-files-5dhh</link>
      <guid>https://dev.to/clouddiadem/linux-commands-trying-out-linux-commands-with-directories-and-files-5dhh</guid>
      <description>&lt;h2&gt;
  
  
  Linux Commands
&lt;/h2&gt;

&lt;p&gt;"So what is Linux? Can you explain to me like I am 5 years old?"&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Ps: I'll be using folders and directory interchangeably but they mean the same thing&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Suppose you own a large box filled with vibrant building blocks. These blocks have incredible power! They can construct robots, cars, planes, even houses. Linux can be thought of as a unique collection of instructions that explains how to use these blocks for play.&lt;/p&gt;

&lt;p&gt;Now imagine that you want to use your building pieces to create a cool robot. Linux makes things easier for you by demonstrating exactly which blocks to use and how to combine them. It identifies the bricks that make up the robot's limbs, legs, eyes, and even brain!&lt;/p&gt;

&lt;p&gt;However, Linux isn't limited to robot construction. It can also assist you in creating other enjoyable things out of your blocks, such as building a spaceship to travel across space or a fantastical palace to house your toys.&lt;/p&gt;

&lt;p&gt;Thus, Linux may be thought of as a useful manual that demonstrates how to utilize your basic building blocks to create a plethora of beautiful things and have a great time!&lt;/p&gt;

&lt;p&gt;Linux is &lt;strong&gt;&lt;em&gt;an open-source operating system developed by Linus Torvalds. It is an operating system just like Windows and MacOS.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I want to walk you through an exercise where you get to use linux commands to walk around especially if this is your first time. Try it and let me know how it goes!&lt;/p&gt;

&lt;h2&gt;
  
  
  EXERCISE
&lt;/h2&gt;

&lt;p&gt;Create your login name and name it anything. I name mine altschool i.e., home directory /home/altschool. The home directory contains the following sub-directories: code, tests, personal, misc Unless otherwise specified, you are running commands from the home directory.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I will share each step with commands needed to run in the terminal. They will be embedded inline codes.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;i. Create a login name called Altschool on your terminal from your root user. You can use vagrant virtual machine or gitbash&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo useradd -Ums /bin/bash Altschool&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YwthQv6X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707514253793/5c84cfdd-394e-43ac-a45d-8c499944e8ee.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YwthQv6X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707514253793/5c84cfdd-394e-43ac-a45d-8c499944e8ee.png" alt="sudoadd" width="685" height="92"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;useradd&lt;/code&gt; command helps you create a new login user&lt;/p&gt;

&lt;p&gt;-Ums&lt;/p&gt;

&lt;p&gt;&lt;code&gt;U&lt;/code&gt; flag creates user and assign a group with same name as the user.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;m&lt;/code&gt; flag creates the home directory.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;s&lt;/code&gt; flag specifies the default login shell&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;ii. Switch user from vagrant (root user) to Altschool user created&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo su Altschool&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FzsTmnid--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707515755801/acdef3b7-f005-471e-9abc-9ad45d217618.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FzsTmnid--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707515755801/acdef3b7-f005-471e-9abc-9ad45d217618.png" alt="sudo su" width="780" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;sudo&lt;/code&gt; is the command that allows regular users to perform administrative tasks or commands that typically require root or superuser privileges&lt;/p&gt;

&lt;p&gt;&lt;code&gt;su&lt;/code&gt; allows you to switch to a different user account from the command line, including the root or superuser account.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;iii. create sub directories named &lt;strong&gt;code, tests, personal &amp;amp; misc&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir code tests personal misc&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;ls&lt;/code&gt; to check that the list of the directories created are in the home directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IjBKCPb4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707516200431/fdba1a3f-713f-485c-98bf-3dc2ab611844.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IjBKCPb4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707516200431/fdba1a3f-713f-485c-98bf-3dc2ab611844.png" alt="ls" width="564" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;mkdir&lt;/code&gt; means make directory. It is a command in Linux for creating new directories or folders to organize your files and data.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ls&lt;/code&gt; means list. This is used to display a list of files and directories in the current directory or a specified directory.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Instructions:
&lt;/h2&gt;

&lt;p&gt;Just before we get to the exercise, let us discuss the difference between &lt;strong&gt;Home Directory&lt;/strong&gt; (&lt;code&gt;cd /home&lt;/code&gt;) and &lt;strong&gt;Root Directory&lt;/strong&gt; (&lt;code&gt;cd /&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;The home directory is a directory connected to each user account, holding personal files and configurations unique to that user, while the root directory is the top level directory in the file system hierarchy which houses the necessary system files.&lt;/p&gt;

&lt;p&gt;a.Change directory to the &lt;strong&gt;tests&lt;/strong&gt; directory using absolute pathname&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd /home/Altschool/tests&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rwEiOqoM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707517407571/91e8fa6d-9088-4042-a9ad-d177e689812f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rwEiOqoM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707517407571/91e8fa6d-9088-4042-a9ad-d177e689812f.png" alt="cd" width="522" height="71"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;cd&lt;/code&gt; means change directory. It is a command that is used to move to another directory. Like changing from the present directory to another existing directory of your choice&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Absolute pathname&lt;/strong&gt; specifies the location of a file or directory from the root directory of the file system. It provides the complete path starting from the root directory and includes all intermediate directories. For example, in a Unix-like file system, an absolute pathname might look like /home/Altschool/tests, where the first "/" after the "cd" command represents the root directory. Think of it like giving directions starting from the very bottom of the tree, the roots. So, if we want to find something, we start from the roots and follow the path all the way up to the branch where it's stored&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;b. Change directory to the &lt;strong&gt;tests&lt;/strong&gt; directory using relative pathname&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd ./tests&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y5hIvAPT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707517798506/4ed683ae-6092-49f6-978b-e16fd806ee65.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y5hIvAPT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707517798506/4ed683ae-6092-49f6-978b-e16fd806ee65.png" alt="tests" width="566" height="75"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When you wish to refer to files or directories in relation to where you currently are in the filesystem hierarchy, &lt;strong&gt;relative pathnames&lt;/strong&gt; come in handy just like &lt;code&gt;cd ./tests&lt;/code&gt;. They are frequently more practical and shorter than absolute pathnames. It describes the path from the current directory. For example, if the current directory is /home/Altschool/, a relative pathname to access the file tests located in the Altschool directory would be "cd tests" or "cd ./tests" where the first "." after the "cd" means you want to search in the present folder and the "/tests" is the folder you want to change to, particularly for moving across directories that share a structure. But if you change the current working directory, they could become unclear.&lt;/p&gt;

&lt;p&gt;The same relative pathname may correspond to multiple files or directories depending on where you are in the filesystem because relative pathnames are interpreted based on the current working directory.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;c. Use echo command to create a file named fileA with text content ‘Hello A’ in the misc directory. (remember we are doing everything along each step in the home directory of &lt;strong&gt;Altschool&lt;/strong&gt; user)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo 'Hello A' &amp;gt; misc/fileA&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cr1Z9uaO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707518171848/b15a3785-c203-44a9-b3b4-a2a41026fd2b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cr1Z9uaO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707518171848/b15a3785-c203-44a9-b3b4-a2a41026fd2b.png" alt="echo" width="528" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;echo&lt;/code&gt; command is used for printing text or variables to the terminal or into a file in the terminal. One cool thing I love about the &lt;code&gt;echo&lt;/code&gt; command is that you can print into a new file on one line of command, redirecting the output of a command into a new file using the "&amp;gt;" symbol. The file does not necessarily have to be created before you can print in it. I hope that is clear. Check the attached image for context.&lt;/p&gt;

&lt;p&gt;Also, since we are creating and using all commands in the home directory of Altschool, we will have to echo into &lt;code&gt;misc/fileA&lt;/code&gt; following the path of misc.&lt;/p&gt;

&lt;p&gt;Then use the &lt;code&gt;ls&lt;/code&gt; command (I already explained it previously) with the &lt;code&gt;-al&lt;/code&gt; flag to check for ALL directories, files, and everything in that directory. You can always have a directory inside a directory. A directory is synonymous to a folder.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;d. Create an empty file named fileB in the misc directory. Populate the file with a dummy content afterwards&lt;/p&gt;

&lt;p&gt;&lt;code&gt;touch misc/fileB&lt;/code&gt; to create the fileB&lt;/p&gt;

&lt;p&gt;&lt;code&gt;nano misc/fileB&lt;/code&gt; to write in a dummy content in the fileB&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cat misc/fileB&lt;/code&gt; to check the content in the fileB&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qavvlYET--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707518613397/b4fa555b-acc9-4b10-9759-89d1096f9af0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qavvlYET--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707518613397/b4fa555b-acc9-4b10-9759-89d1096f9af0.png" alt="cat" width="521" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;touch&lt;/code&gt; command is used to create files.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;nano&lt;/code&gt; is a text editor that is commonly used for quick edits, viewing configuration files, or making simple changes to text files in Linux environments. It's especially popular on servers or systems without graphical user interfaces (GUIs) where command-line tools are preferred. One down side of this command is that your mouse won't function on the screen while in the text editor. The use of arrow keys and alphabet keys on the keyboard Allows you to do the job of writing and editing text on the screen.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cat&lt;/code&gt; is a "concatenate"command. It is a versatile and handy tool for quickly viewing the contents of files in the terminal after writing inside the file.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;e. Copy contents of fileA into fileC&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cp misc/fileA misc/fileC&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MtfYlsst--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707519171800/194ac850-d228-4f0a-ae1e-82821da13d9f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MtfYlsst--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707519171800/194ac850-d228-4f0a-ae1e-82821da13d9f.png" alt="cp" width="531" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;cp&lt;/code&gt; command as it literally mean is to copy content from a file to another file while retaining contents and the file the initial copy was made from.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;f. Move contents of fileB into fileD&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mv misc/fileB misc/fileD&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HshmEujC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707519446983/74e3afe2-1fd8-481b-aa19-1d97b2ff3619.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HshmEujC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707519446983/74e3afe2-1fd8-481b-aa19-1d97b2ff3619.png" alt="mv" width="519" height="120"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;mv&lt;/code&gt; can be used to move contents of a file to another, and also directories. You can also use it to rename files and directory.This flexibly allows renaming files and directories as well as conviently moving contents from a former file to a new one .This implies that the old file from which the contents were moved from will cease to exist.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;g. Create a tar archive called misc.tar for the contents of misc directory&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tar -cvf misc.tar misc&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k6Sf5w4Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707520172820/52067b2f-09ff-40c5-8156-f411145a9f8f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6Sf5w4Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707520172820/52067b2f-09ff-40c5-8156-f411145a9f8f.png" alt="tar" width="504" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;the &lt;code&gt;tar&lt;/code&gt; command offers a flexible and powerful way to archive and manage files and directories in Linux systems.&lt;/p&gt;

&lt;p&gt;Then the &lt;code&gt;-cvf&lt;/code&gt; flag will be broken into bits so it will enable me explain them better. The &lt;code&gt;c&lt;/code&gt; flag is used to create archive. The &lt;code&gt;v&lt;/code&gt; flag stands for "verbose." When used, &lt;code&gt;tar&lt;/code&gt; will display detailed information about the files and directories being archived.The &lt;code&gt;f&lt;/code&gt; flag stands for "file." It is used to specify the name of the archive file.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;h. Compress the tar archive to create a misc.tar.gz file&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gzip misc.tar&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f2UkBaY1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707520615900/a604b814-fbdc-441d-a52d-4557a2a97d06.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f2UkBaY1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707520615900/a604b814-fbdc-441d-a52d-4557a2a97d06.png" alt="gzip" width="525" height="97"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;gzip&lt;/code&gt; command is used for compressing files to save disk space or reduce transfer times when transferring files over a network.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;i. Create a user and force the user to change his/her password upon login&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo chage -d 0 praise&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VaAPC7V1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707520825018/bfbda5a8-6307-40c4-be29-8dd58a3faa5d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VaAPC7V1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707520825018/bfbda5a8-6307-40c4-be29-8dd58a3faa5d.png" alt="sudo chage" width="563" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Remember I already explained what sudo is above right? So we would not touch it anymore.&lt;/p&gt;

&lt;p&gt;When it comes to setting password expiration rules for user accounts on Linux systems, administrators have flexibility thanks to the &lt;code&gt;chage&lt;/code&gt; command. Because administrators may tailor password aging policies to meet organizational needs, it helps enforce security best practices by guaranteeing that users update their passwords on a regular basis.&lt;/p&gt;

&lt;p&gt;When a system administrator create a new user on the server of a company he/she creates the user with a password and the sends the details to that user to login ... To ensure the user's account is safe he/she(administrator) forces the user to change the password upon first login so that only the user has the new password&lt;/p&gt;

&lt;p&gt;In the context of the &lt;code&gt;chage&lt;/code&gt; command, the &lt;code&gt;-d&lt;/code&gt; flag is used to set the date of the last password change for a user account. This flag allows the administrator to manually specify how many times the user should use the old password created by him/her(the administrator), and that is why we have &lt;code&gt;0&lt;/code&gt; as it means the number of time a user can use the password before changing it. Apparantly, the user can only use the password the one time they used it in logging in.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;j. Lock a users password&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo passwd -l praise&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cGzM1tkt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707521121058/c6077e1c-e080-49b6-ac39-fae375b9d145.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cGzM1tkt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707521121058/c6077e1c-e080-49b6-ac39-fae375b9d145.png" alt="sudo passwd" width="547" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;passwd&lt;/code&gt; command means password. and combined with the &lt;code&gt;-l&lt;/code&gt; flag it is used to lock a user account. It prevents users from logging in. Locking user accounts is useful for temporarily preventing access to an account, such as during maintenance or investigation of security issues. It can also be used as a security measure if a user's access needs to be revoked temporarily or permanently.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;k. Create a user with no login shell&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo useradd -s /sbin/nologin Vicky&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tql_DMis--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707521497913/4a2d80d6-e9ec-4cc4-893b-b451f02544a6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tql_DMis--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707521497913/4a2d80d6-e9ec-4cc4-893b-b451f02544a6.png" alt="sudo useradd" width="566" height="96"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;-s /sbin/nologin&lt;/code&gt; command is used to set the login shell for a user account to &lt;code&gt;/sbin/nologin&lt;/code&gt;. A user account configured with /sbin/nologin as its login shell will prevent interactive logins through Telnet, SSH, or other means. Rather, upon attempting to log in, the user will be met with an error message stating that login is prohibited, usually accompanied with an administrator-provided message. By preventing interactive logins, it helps enhance the security of the system by limiting potential points of unauthorized access.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;grep&lt;/code&gt; command is used to search contents of a file... in the command &lt;code&gt;cat /etc/passed | grep username&lt;/code&gt; the "|" is a pipe symbol used to redirect the output of a command into another command which is the &lt;code&gt;grep&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;l. Disable password based authentication for ssh&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo vi /etc/ssh/sshd_config&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Oy9wtxNQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707521882802/3ab775da-6332-44bb-997e-ae8e7b447ccd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Oy9wtxNQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707521882802/3ab775da-6332-44bb-997e-ae8e7b447ccd.png" alt="sudo vi" width="688" height="61"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The command &lt;code&gt;vi /etc/ssh/sshd_config&lt;/code&gt; is used to open the SSH daemon configuration file (&lt;code&gt;sshd_config&lt;/code&gt;) in the &lt;code&gt;vi&lt;/code&gt; text editor,just like the &lt;code&gt;nano&lt;/code&gt; text editor we talked about earlier.&lt;/p&gt;

&lt;p&gt;Here's a breakdown of what each part of the command does:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;vi&lt;/code&gt;: This is the command to invoke the &lt;code&gt;vi&lt;/code&gt; text editor in the terminal. &lt;code&gt;vi&lt;/code&gt; is a widely used text editor in Unix-like operating systems, including Linux.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;: This is the path to the SSH daemon configuration file. In most Linux distributions, SSH (Secure Shell) configuration files are stored in the &lt;code&gt;/etc/ssh/&lt;/code&gt; directory. The &lt;code&gt;sshd_config&lt;/code&gt; file specifically contains configuration settings for the SSH daemon (&lt;code&gt;sshd&lt;/code&gt;), which is the server-side component of the SSH protocol. This file controls various aspects of the SSH server's behavior, such as authentication methods, allowed users, permitted protocols, and more.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Therefore, when you run &lt;code&gt;vi /etc/ssh/sshd_config&lt;/code&gt;, you are opening the &lt;code&gt;sshd_config&lt;/code&gt; file in the &lt;code&gt;vi&lt;/code&gt; text editor, allowing you to view and edit the configuration settings for the SSH daemon.&lt;/p&gt;

&lt;p&gt;From the screenshot in line 47 &lt;strong&gt;PasswordAuthentication&lt;/strong&gt; is set to '&lt;strong&gt;no'&lt;/strong&gt; which disables the password authentication for ssh.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;m. Disable root login for ssh&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vi /etc/ssh/sshd_config&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Xz48m6jw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707522035649/e372fc66-8c1f-40a0-844f-c75e4fad1009.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Xz48m6jw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1707522035649/e372fc66-8c1f-40a0-844f-c75e4fad1009.png" alt="vi" width="624" height="58"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a continuation from the disabled authentication, scroll back up on the vi editor to line 29 where you have PermitRootLogin and set it to 'no' and save it. You save by pressing the esc key then the double colon (:) followed by the "wq" to save it then you press ENTER to leave the test editor. It should look like this &lt;code&gt;:wq&lt;/code&gt; . There you go!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;In summary, as you navigate the terminal, embrace the learning process with patience and perseverance. Every error is a chance to deepen your understanding, and each solution adds to your expertise. Keep exploring, keep learning, and let your discoveries empower your Linux journey. Your thoughts, experiences, and feedback are valuable—feel free to share them with others in our vibrant community of learners. Together, we can inspire and support each other on this exciting adventure through the command line.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>linuxcommands</category>
      <category>linuxfiles</category>
      <category>linuxdirectories</category>
    </item>
    <item>
      <title>Install, Configure, and Host a Custom Website on Apache2 Web Server, with Ubuntu, Using AWS EC2 Instance</title>
      <dc:creator>Adaeze Nnamdi-Udekwe</dc:creator>
      <pubDate>Fri, 22 Mar 2024 11:26:16 +0000</pubDate>
      <link>https://dev.to/clouddiadem/install-configure-and-host-a-custom-website-on-apache2-web-server-with-ubuntu-using-aws-ec2-instance-41eo</link>
      <guid>https://dev.to/clouddiadem/install-configure-and-host-a-custom-website-on-apache2-web-server-with-ubuntu-using-aws-ec2-instance-41eo</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Ubuntu provides the foundation and infrastructure necessary to run web server software like Apache2, enabling it to serve web content to clients over the internet.&lt;/p&gt;

&lt;p&gt;We will be covering Installing, Configuring, and Hosting a Custom Website on Apache2 Web Server, with Ubuntu, Using AWS EC2 Instance.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you will need for this Hands-on
&lt;/h2&gt;

&lt;p&gt;•AWS management console&lt;/p&gt;

&lt;p&gt;•AWS EC2 Instance (free tier) . You can check the &lt;a href="https://aws.amazon.com/ec2/pricing/?gclid=CjwKCAiA_tuuBhAUEiwAvxkgTjhwPjDJbSsyuUaPZC80TGMbUf2-QCfGWa5Ua7dsHN7quu7gs_x6eBoCpa0QAvD_BwE&amp;amp;trk=52f9267b-dca0-4589-9a8c-547fc84b784f&amp;amp;sc_channel=ps&amp;amp;ef_id=CjwKCAiA_tuuBhAUEiwAvxkgTjhwPjDJbSsyuUaPZC80TGMbUf2-QCfGWa5Ua7dsHN7quu7gs_x6eBoCpa0QAvD_BwE:G:s&amp;amp;s_kwcid=AL!4422!3!669047422248!e!!g!!amazon%20ec2%20price!20433874242!155026711889" rel="noopener noreferrer"&gt;pricing list&lt;/a&gt; here if you do not have a free-tier account&lt;/p&gt;

&lt;p&gt;•GitHub account&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up of EC2 Instance
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Log into your AWS management console to begin this hands-on. Navigate to the EC2 instance by searching for the service in the console and click on it so you can create an instance. Click on 'launch instance'. I have marked it in a rectangular shape. Please take note of every area I emphasized with a circle or rectangle in the course of explaining this project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708447699710%2Fb79eb029-3f5c-4a03-9021-2bb6e24d40f1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708447699710%2Fb79eb029-3f5c-4a03-9021-2bb6e24d40f1.png" alt="1"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After clicking on the 'launch instance', name your instance and then proceed to pick your Operating system (AMI) as Ubuntu. Make sure it is the free trier just like my screenshot so you do not incur costs while trying to set up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708448372339%2F624c5421-c7c9-4265-9506-96d11a31d0c2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708448372339%2F624c5421-c7c9-4265-9506-96d11a31d0c2.png" alt="2"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Proceed to create a key pair or use an existing key pair like I did. The key pair is used for secure SSH (Secure Shell) access to the instance. Scroll down to the security group and allow SSH traffic and HTTP traffic. I am emphasizing this because when I attempted this task severally, I kept getting errors when I tried to load my Apache2 on my web. This was because I did not allow for HTTP in my security group. No way that was going to work because enabling HTTP in your security group is crucial for ensuring that your web server can effectively communicate with clients and provide access to your online content and services in a secure and efficient manner. Go ahead to launch your instance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708455739243%2F9d4299bb-13dd-42bf-bd37-84c43d573f35.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708455739243%2F9d4299bb-13dd-42bf-bd37-84c43d573f35.png" alt="3"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After the instance created shows the &lt;strong&gt;&lt;em&gt;running&lt;/em&gt;&lt;/strong&gt; state, click on the check box, then proceed to click on connect.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708456799638%2Fa168006d-f78f-4e0a-a945-b5b99168f444.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708456799638%2Fa168006d-f78f-4e0a-a945-b5b99168f444.png" alt="4"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go ahead to "connect using the Instance Connect". Click on the orange button saying "Connect". You will be taken to a terminal.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708456980206%2Ff4418405-e47a-4b9c-9db3-22f8abab151a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708456980206%2Ff4418405-e47a-4b9c-9db3-22f8abab151a.png" alt="5"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Apache2
&lt;/h2&gt;

&lt;p&gt;One of the most extensively used open-source web servers in the world is Apache2, sometimes known as Apache HTTP Server or just Apache. The internet can receive web content thanks to Apache2. It is a well-liked option for hosting websites and web applications because of its great versatility, scalability, and customization. Web apps and dynamic websites are frequently made with Apache2. It is a reliable option for companies, organizations, and site hosts all around the world.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Run the command &lt;code&gt;sudo apt update&lt;/code&gt; on your terminal to check for new updates. It should look like what is in the screenshot below.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708458136337%2F52238566-80a0-40c2-aa29-624a9c13f6cc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708458136337%2F52238566-80a0-40c2-aa29-624a9c13f6cc.png" alt="6"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Proceed to install Apache by running &lt;code&gt;sudo apt install apache2&lt;/code&gt; command. You will see "Do you want to continue? [Y/n]". Type Y and press enter on your keyboard. You should see something like what is in the screenshot below. Copy the circled Public IP address and run it on your browser.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708458583023%2F723a6f66-aec9-4bce-ba86-78e9857b1481.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708458583023%2F723a6f66-aec9-4bce-ba86-78e9857b1481.png" alt="7"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Boom! You should have this page on your web after running your own unique Public IP address. Your IP address is not expected to look like mine. You would have your own unique address.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708458819465%2F80d49180-e835-4a47-9659-8e65f6f8ee46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708458819465%2F80d49180-e835-4a47-9659-8e65f6f8ee46.png" alt="8"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hosting Custom Website on Apache2 Web Server.
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install git on your terminal first by running this command &lt;code&gt;sudo apt install git&lt;/code&gt;. You should have something like what is in the screenshot below. We are installing git so that we use it to clone some codes from my &lt;a href="https://github.com/Adaeze-69/Alt-School-Assignment-3.git" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt; that we will use as our custom website. You can go ahead and click on the link and use it for this demonstration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708462460953%2F4edc527b-b8f3-4507-b896-d2519573d6d9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708462460953%2F4edc527b-b8f3-4507-b896-d2519573d6d9.png" alt="9"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a folder next and name it whatever you want using the command &lt;code&gt;mkdir 'foldername'&lt;/code&gt; , for example &lt;code&gt;mkdir adaeze&lt;/code&gt; . This is the folder we will be putting our cloned git repository. Change your directory to the new folder created using the &lt;code&gt;cd&lt;/code&gt; command. Something like &lt;code&gt;cd adaeze&lt;/code&gt; since 'adaeze' is the directory/folder I created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708463240589%2Fc932921e-f9d0-4c0f-8072-7d6800a7deb1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708463240589%2Fc932921e-f9d0-4c0f-8072-7d6800a7deb1.png" alt="10"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Get any git repository with codes for a website or you can use &lt;a href="https://github.com/Adaeze-69/Alt-School-Assignment-3.git" rel="noopener noreferrer"&gt;mine&lt;/a&gt;. In the repository, click on the circled part that says 'code' colored green. Then copy to the clipboard using the button I circled as number 2.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708462859798%2Fbc74c597-d409-4fe9-af92-7e2ed2bbd9d7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708462859798%2Fbc74c597-d409-4fe9-af92-7e2ed2bbd9d7.png" alt="11"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go back to your terminal to clone the repository. the &lt;code&gt;git clone&lt;/code&gt; command is an essential tool for getting a local copy of a remote &lt;br&gt;
Git repository. So it should look like this &lt;code&gt;git clone https://github.com/Adaeze-69/Alt-School-Assignment-3.git&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708464377689%2F8cf6c280-05ad-4044-8c9f-09641ad64869.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708464377689%2F8cf6c280-05ad-4044-8c9f-09641ad64869.png" alt="12"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Change the directory into the cloned repository. The command to run is &lt;code&gt;cd Alt-School-Assignment-3/&lt;/code&gt; .This is the directory where all &lt;br&gt;
your codes are found. Your HTML and CSS codes you cloned. Remember that this directory is inside the 'adaeze' directory which has &lt;br&gt;
been your present working directory (pwd). See the screenshot below to understand better.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708465647827%2Fe2dceace-58d4-478c-babd-e7abcd212753.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708465647827%2Fe2dceace-58d4-478c-babd-e7abcd212753.png" alt="13"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;ls&lt;/code&gt; command to see the list of files in the cloned directory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708466088957%2Fdd4010cc-4807-4d63-9b3d-c41bb155786e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708466088957%2Fdd4010cc-4807-4d63-9b3d-c41bb155786e.png" alt="13"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create another directory that will host your website. It should be like this: &lt;code&gt;sudo mkdir /var/www/newfilefolder&lt;/code&gt; . Mine looks like 
this: &lt;code&gt;sudo mkdir /var/www/adaezennamdi&lt;/code&gt; .&lt;/li&gt;
&lt;li&gt;Next is to copy the content of everything in the present directory that you are. For me, &lt;code&gt;/adaeze/Alt-School-Assignment-3&lt;/code&gt; is my 
present working directory, just like the screenshot. The '*' is called a wild card which copies everything in that directory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708466475502%2Ffa2657da-fc55-4b61-9aa1-153f6dd9e3fa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708466475502%2Ffa2657da-fc55-4b61-9aa1-153f6dd9e3fa.png" alt="14"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Next is to &lt;code&gt;cd&lt;/code&gt; into the new file folder you created and &lt;code&gt;ls&lt;/code&gt; to be sure all the contents you copied are present there.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708466694352%2F4aba3c79-f4cc-4cfa-9866-f835e896e07c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708466694352%2F4aba3c79-f4cc-4cfa-9866-f835e896e07c.png" alt="15"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new 'conf' file with the command &lt;code&gt;touch&lt;/code&gt; where you will move the default conf file into&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708517584067%2F123bf574-f7f0-4c28-a4f7-d00e2810e29a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708517584067%2F123bf574-f7f0-4c28-a4f7-d00e2810e29a.png" alt="16"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Copy the contents of everything in the default conf file into the newly created 'conf' file which in my case is 
'adaezennamdi.conf'. It should look like this &lt;code&gt;sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites- 
available/adaezennamdi.conf&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708517913612%2F36d784ed-a6f5-489d-adc6-84946a351573.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708517913612%2F36d784ed-a6f5-489d-adc6-84946a351573.png" alt="17"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go ahead to edit the new 'conf' file you created using the command &lt;code&gt;sudo nano /etc/apache2/sites-available/adaezennamdi.conf&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708518245832%2F08d52bf2-1f57-490e-bf69-5cac68823c23.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708518245832%2F08d52bf2-1f57-490e-bf69-5cac68823c23.png" alt="18"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When you get into the nano editor, scroll down to &lt;strong&gt;DocumentRoot&lt;/strong&gt;. Where you see 'adaezennamdi', you will see 'html'. Delete the 
'html' and write the new name you gave to your folder you created in the &lt;code&gt;/var/www/foldername&lt;/code&gt;. Mine is 'adaezennamdi' and that is 
why you see it there. After that, press 'ctrl O' on your keyboard to save, press the 'Enter' key, and then 'ctrl X' to exit the          editor.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708518394555%2Fd1a27ba6-1e4a-4050-9c79-a678009216e9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708518394555%2Fd1a27ba6-1e4a-4050-9c79-a678009216e9.png" alt="19"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Enable your created custom new conf file with the command &lt;code&gt;sudo a2ensite adaezennamdi.conf&lt;/code&gt;. Please, remember to use your own 
'conf file' name you created and not mine.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708518852782%2F75f1ceb8-a90d-4fa0-97a1-6c5cb09f56ea.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708518852782%2F75f1ceb8-a90d-4fa0-97a1-6c5cb09f56ea.png" alt="20"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Disable the 'default conf file' &lt;code&gt;000-default.conf&lt;/code&gt; whose contents were copied. The command should look like this &lt;code&gt;sudo a2dissite 
000-default.conf&lt;/code&gt; . If you do not disable this, your site will not load because this will still be running. Disabling it is 
necessary as this process will allow your enabled "Conf" from the previous steps to run efficiently.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708519145910%2F5880ad1a-7940-4d12-88cb-0b223c8b9365.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708519145910%2F5880ad1a-7940-4d12-88cb-0b223c8b9365.png" alt="21"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;At this point, you will need to reload your apache2 web server. To do that, type &lt;code&gt;sudo systemctl reload apache2&lt;/code&gt; into your 
terminal.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708519437720%2F9e5eb498-4082-4333-991e-57ba8ffc73eb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708519437720%2F9e5eb498-4082-4333-991e-57ba8ffc73eb.png" alt="22"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On your web browser, revisit the Apache2 web server page (refer to step 4), process to reload it, and confirm if you have a 
similar snapshot with the image below (the image will be exact if you cloned my repository).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708519638391%2F4b8c701a-f42b-4c8c-b118-0d278356b057.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708519638391%2F4b8c701a-f42b-4c8c-b118-0d278356b057.png" alt="23"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Remember to terminate your AWS EC2 instance when you get to this point. Do not stop it but terminate. If you stop it, you will 
still incur costs from the Elastic Block Storage (EBS) Volume running with it. Terminate the EC2 instance. From the screenshots 
below, tick the checkbox, then click on the drop-down 'instance state' . You will see 'Terminate instance'. Click on it to 
redirect you to the page on the second screenshot. Click on 'Terminate' that is circled, and that is all.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708636435730%2F1fd412cd-7a07-4bd8-b708-c7f59d1ab3c6.png" alt="24"&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708636598234%2F34002643-504d-405b-a8d4-a46e9fe50a33.png" alt="25"&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Congratulations on completing the guide to Installing, Configuring, and Hosting a Custom Website on Apache2 Web Server, with Ubuntu, Using AWS EC2 Instance. While the process may have been challenging, your perseverance paid off. Remember, if you encounter challenges, seek help from documentation or online resources. You can also reach out to me on this platform too.&lt;/p&gt;

&lt;p&gt;I hope you found value in this article and enjoyed the journey as much as I did creating it. Your dedication enriches our community. Keep exploring and innovating. Here's to your continued success!&lt;/p&gt;

&lt;p&gt;Feel free to share your feedback and experiences. Best wishes on your future endeavors!&lt;/p&gt;

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