<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://skfaizan.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 30 Aug 2026 16:55:02 GMT</lastBuildDate><atom:link href="https://skfaizan.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Seamless DevOps: Deploying a Django Todo App with Docker]]></title><description><![CDATA[Deploying Django Todo App on AWS EC2, Docker Setup, and Cleanup:
EC2 INSTANCE SETUP:

Create an EC2 Instance with Ubuntu and clone the GitHub repository at https://github.com/FaizanShaikh1/django-todo.git .

Update the instance with the latest depend...]]></description><link>https://skfaizan.hashnode.dev/seamless-devops-deploying-a-django-todo-app-with-docker</link><guid isPermaLink="true">https://skfaizan.hashnode.dev/seamless-devops-deploying-a-django-todo-app-with-docker</guid><category><![CDATA[Docker]]></category><category><![CDATA[Django]]></category><category><![CDATA[Python 3]]></category><category><![CDATA[Python]]></category><category><![CDATA[EC2 instance]]></category><category><![CDATA[AWS]]></category><dc:creator><![CDATA[Faizan Shaikh]]></dc:creator><pubDate>Mon, 15 Jan 2024 18:30:36 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1705343306985/164e1186-799e-419f-b366-cfd8b04feced.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Deploying Django Todo App on AWS EC2, Docker Setup, and Cleanup:</p>
<p><strong>EC2 INSTANCE SETUP:</strong></p>
<ul>
<li><p>Create an EC2 Instance with Ubuntu and clone the GitHub repository at <a target="_blank" href="https://github.com/FaizanShaikh1/django-todo.git">https://github.com/FaizanShaikh1/django-todo.git</a> .</p>
</li>
<li><p>Update the instance with the latest dependencies using the command:</p>
<pre><code class="lang-bash">  sudo apt-get update
</code></pre>
</li>
<li><p>Navigate to the django-todo repository directory:</p>
<pre><code class="lang-bash">  <span class="hljs-built_in">cd</span> django-todo/
</code></pre>
</li>
<li><p>Install the Django package:</p>
<pre><code class="lang-bash">  sudo apt install python3-pip -y
  pip install django
</code></pre>
</li>
<li><p>Perform database migrations:</p>
<pre><code class="lang-bash">  python3 manage.py migrate
</code></pre>
</li>
<li><p>Edit the /django/todoApp/<a target="_blank" href="http://settings.py">settings.py</a> file to include the host IP or set it to '*' by running:</p>
<pre><code class="lang-bash">  vi /django/todoApp/settings.py
</code></pre>
<p>  Inside the file, update <code>ALLOWED_HOSTS</code> to either <code>['your_host_public_ip']</code> or <code>['*']</code>.</p>
</li>
<li><p>Start the Django development server accessible only on <a target="_blank" href="http://localhost">localhost</a>:</p>
<pre><code class="lang-bash">  python3 manage.py runserver
</code></pre>
</li>
<li><p>To make it accessible from any IP, modify the inbound rule in the security group by allowing 0.0.0.0 IP on port 8000. Access the application at &lt;your_host_public_ip&gt;:8000 by running:</p>
<pre><code class="lang-bash">  python3 manage.py runserver 0.0.0.0:8000
</code></pre>
</li>
<li><p>Your todo app is now accessible through a web browser.</p>
</li>
<li><p>To run the application in the background, use the following command:</p>
<pre><code class="lang-bash">  nohup python3 manage.py runserver 0.0.0.0:8000 &amp;
</code></pre>
</li>
<li><p>For monitoring and terminating the task, use the following commands:</p>
<p>  To list processes using port 8000:</p>
<pre><code class="lang-bash">  lsof -i:8000
</code></pre>
<p>  To terminate a specific task identified by its Process ID (PID):</p>
<pre><code class="lang-bash">  <span class="hljs-built_in">kill</span> -9 &lt;PID_ID&gt;
</code></pre>
<p>  Replace <code>&lt;PID_ID&gt;</code> with the actual Process ID you wish to terminate.</p>
</li>
</ul>
<p><strong>DOCKER SETUP:</strong></p>
<ul>
<li><p>Install Docker:</p>
<pre><code class="lang-bash">  sudo apt install docker.io -y
</code></pre>
</li>
<li><p>Create Dockerfile: Open the Dockerfile using a text editor:</p>
<pre><code class="lang-bash">  vi Dockerfile
</code></pre>
<p>  Add the following content:</p>
<pre><code class="lang-Dockerfile">  <span class="hljs-keyword">FROM</span> python:<span class="hljs-number">3</span>

  <span class="hljs-keyword">RUN</span><span class="bash"> pip install django==3.2</span>

  <span class="hljs-keyword">COPY</span><span class="bash"> . .</span>

  <span class="hljs-keyword">RUN</span><span class="bash"> python manage.py migrate</span>

  <span class="hljs-keyword">CMD</span><span class="bash"> [<span class="hljs-string">"python"</span>, <span class="hljs-string">"manage.py"</span>, <span class="hljs-string">"runserver"</span>, <span class="hljs-string">"0.0.0.0:8000"</span>]</span>
</code></pre>
<p>  Save and exit by typing <code>:wq</code>.</p>
</li>
<li><p>Build Docker Image:</p>
<pre><code class="lang-bash">  sudo docker build . -t todo-app
</code></pre>
<p>  The image is now created.</p>
</li>
<li><p>Check Running Containers:</p>
<pre><code class="lang-bash">  sudo docker ps
</code></pre>
<p>  If no containers are running, proceed to the next step.</p>
</li>
<li><p>Run Docker Container:</p>
<pre><code class="lang-bash">  sudo docker run -p 8000:8000 &lt;build_id&gt;
</code></pre>
<p>  To run in the background and create a detached container:</p>
<pre><code class="lang-bash">  sudo docker run -d -p 8000:8000 &lt;build_id&gt;
</code></pre>
<p>  Now, the Docker container is created and running.</p>
</li>
</ul>
<p><strong>REMOVE DOCKER CONTAINER:</strong></p>
<ul>
<li><p>List all Docker containers (running and stopped):</p>
<pre><code class="lang-bash">  sudo docker ps -a
</code></pre>
<p>  This will display a list of containers along with their IDs.</p>
</li>
<li><p>Remove the Docker container:</p>
<pre><code class="lang-bash">  sudo docker rm &lt;container_id&gt;
</code></pre>
<p>  Replace <code>&lt;container_id&gt;</code> with the actual ID of the container you want to remove.</p>
<p>  If the container is still running, you might need to stop it first using <code>docker stop</code>:</p>
<pre><code class="lang-bash">  sudo docker stop &lt;container_id&gt;
</code></pre>
<p>  And then remove it.</p>
</li>
<li><p>After completion, terminate the EC2 instance.</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Hosting Your Website on AWS S3 with Terraform]]></title><description><![CDATA[Welcome to another exciting journey into the world of cloud infrastructure! In this article, we'll explore how to host a simple static website on Amazon S3 using Terraform.
Prerequisites
Before we begin, make sure you have the following:

An AWS acco...]]></description><link>https://skfaizan.hashnode.dev/hosting-your-website-on-aws-s3-with-terraform</link><guid isPermaLink="true">https://skfaizan.hashnode.dev/hosting-your-website-on-aws-s3-with-terraform</guid><category><![CDATA[hosting]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Terraform]]></category><category><![CDATA[AWS]]></category><category><![CDATA[AWS s3]]></category><category><![CDATA[S3-bucket]]></category><dc:creator><![CDATA[Faizan Shaikh]]></dc:creator><pubDate>Fri, 12 Jan 2024 18:33:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1705084271220/f0eda5bd-6bac-45c7-846e-d34e136e3e8f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome to another exciting journey into the world of cloud infrastructure! In this article, we'll explore how to host a simple static website on Amazon S3 using Terraform.</p>
<h2 id="heading-prerequisites"><strong>Prerequisites</strong></h2>
<p>Before we begin, make sure you have the following:</p>
<ul>
<li><p>An AWS account</p>
</li>
<li><p>Terraform installed on your local machine</p>
</li>
<li><p>Basic knowledge of Terraform and AWS S3 (<em>AWS CLI must be installed</em> )</p>
</li>
</ul>
<h2 id="heading-setting-up-your-project"><strong>Setting Up Your Project</strong></h2>
<p>Let's start by creating a project directory. Inside this directory, create a file named <a target="_blank" href="http://main.tf"><code>main.tf</code></a>. This file will contain your Terraform configuration.</p>
<pre><code class="lang-plaintext">#create s3 bucket
resource "aws_s3_bucket" "mybucket" {
    bucket = var.bucketname
}

resource "aws_s3_bucket_ownership_controls" "example" {
  bucket = aws_s3_bucket.mybucket.id

  rule {
    object_ownership = "BucketOwnerPreferred"
  }
}

resource "aws_s3_bucket_public_access_block" "example" {
  bucket = aws_s3_bucket.mybucket.id

  block_public_acls       = false
  block_public_policy     = false
  ignore_public_acls      = false
  restrict_public_buckets = false
}

resource "aws_s3_bucket_acl" "example" {
  depends_on = [
    aws_s3_bucket_ownership_controls.example,
    aws_s3_bucket_public_access_block.example,
  ]

  bucket = aws_s3_bucket.mybucket.id
  acl    = "public-read"
}

resource "aws_s3_object" "index" {
  bucket = aws_s3_bucket.mybucket.id
  key = "index.html"
  source = "index.html"
  acl = "public-read"
  content_type = "text/html"
}

resource "aws_s3_object" "error" {
  bucket = aws_s3_bucket.mybucket.id
  key = "error.html"
  source = "error.html"
  acl = "public-read"
 content_type = "text/html"
}

resource "aws_s3_object" "profile" {
  bucket = aws_s3_bucket.mybucket.id
  key = "profile.png"
  source = "profile.png"
  acl = "public-read"
}

resource "aws_s3_bucket_website_configuration" "website" {
  bucket = aws_s3_bucket.mybucket.id
  index_document {
    suffix = "index.html"
  }

  error_document {
    key = "error.html"
  }

  depends_on = [ aws_s3_bucket_acl.example ]
}
</code></pre>
<p>create a file named <a target="_blank" href="http://main.tf"><code>provider.tf</code></a>. This file will contain your Terraform Provider info.</p>
<pre><code class="lang-plaintext">provider "aws" {
    region = "us-east-1"
}
</code></pre>
<p>create a file named <a target="_blank" href="http://main.tf"><code>variables.tf</code></a>. This file will contain your Terraform Variables .</p>
<pre><code class="lang-plaintext">variable "bucketname" {
  default = "myterraformprojwebsite001"
}
</code></pre>
<p>create a file named <code>index.html</code>. This file will contain your Website HTML code .</p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"utf-8"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1.0"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>Unitech Public School<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>

    <span class="hljs-comment">&lt;!-- Google Fonts --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i"</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span>&gt;</span>

    <span class="hljs-comment">&lt;!-- Vendor CSS Files --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span>&gt;</span>

    <span class="hljs-comment">&lt;!-- Template Main CSS File --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><span class="css">
        <span class="hljs-selector-tag">body</span> {
            <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span>;
            <span class="hljs-attribute">padding</span>: <span class="hljs-number">0</span>;
            <span class="hljs-attribute">height</span>: <span class="hljs-number">100vh</span>;
            <span class="hljs-attribute">background</span>: <span class="hljs-built_in">url</span>(<span class="hljs-string">'profile.png'</span>) center/cover no-repeat; <span class="hljs-comment">/* Add your image path */</span>
            <span class="hljs-attribute">display</span>: flex;
            <span class="hljs-attribute">flex-direction</span>: column;
            <span class="hljs-attribute">align-items</span>: center;
            <span class="hljs-attribute">justify-content</span>: center;
            <span class="hljs-attribute">color</span>: <span class="hljs-number">#fff</span>; <span class="hljs-comment">/* Light Text Color */</span>
            <span class="hljs-attribute">text-align</span>: center;
            <span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Open Sans'</span>, sans-serif;
        }

        <span class="hljs-selector-class">.school-name</span> {
            <span class="hljs-attribute">font-size</span>: <span class="hljs-number">36px</span>;
            <span class="hljs-attribute">font-weight</span>: bold;
            <span class="hljs-attribute">color</span>: <span class="hljs-number">#fff</span>; <span class="hljs-comment">/* Light Text Color */</span>
            <span class="hljs-attribute">text-shadow</span>: <span class="hljs-number">2px</span> <span class="hljs-number">2px</span> <span class="hljs-number">4px</span> <span class="hljs-number">#333</span>; <span class="hljs-comment">/* Dark Text Shadow */</span>
        }

        <span class="hljs-selector-class">.powered-by</span> {
            <span class="hljs-attribute">font-size</span>: <span class="hljs-number">14px</span>;
            <span class="hljs-attribute">color</span>: <span class="hljs-number">#ccc</span>; <span class="hljs-comment">/* Light Gray Color */</span>
            <span class="hljs-attribute">text-shadow</span>: <span class="hljs-number">1px</span> <span class="hljs-number">1px</span> <span class="hljs-number">2px</span> <span class="hljs-number">#333</span>; <span class="hljs-comment">/* Dark Text Shadow */</span>
        }
    </span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>

    <span class="hljs-comment">&lt;!-- ======= Header ======= --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">header</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"header"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"school-name animated fadeInUp"</span>&gt;</span>Unitech Public School<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"powered-by animated fadeInUp"</span>&gt;</span>Powered by Future Unitech Education Society<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">header</span>&gt;</span><span class="hljs-comment">&lt;!-- End Header --&gt;</span>

    <span class="hljs-comment">&lt;!-- ======= Hero Section ======= --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">section</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"hero"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"d-flex flex-column justify-content-center align-items-center"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"hero-container"</span> <span class="hljs-attr">data-aos</span>=<span class="hljs-string">"fade-in"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Welcome to Unitech Public School<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Your child's first step towards a bright future!<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">section</span>&gt;</span><span class="hljs-comment">&lt;!-- End Hero --&gt;</span>

    <span class="hljs-comment">&lt;!-- ======= About Section ======= --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">section</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"about"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"about"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"text-align: center;"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"section-title"</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>About Us<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">h3</span>&gt;</span>Providing quality education to young minds<span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Hello! Welcome to Unitech Public School, where we nurture young minds and foster a love for learning.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
            <span class="hljs-comment">&lt;!-- Add more content about the school --&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">section</span>&gt;</span><span class="hljs-comment">&lt;!-- End About Section --&gt;</span>

    <span class="hljs-comment">&lt;!-- ... Add more sections as needed --&gt;</span>

    <span class="hljs-comment">&lt;!-- Vendor JS Files --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://code.jquery.com/jquery-3.3.1.slim.min.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>

<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>

<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p>create a file named <code>error.html</code>. This file will contain your error html info.</p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1.0"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>Error - John's Portfolio<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"styles.css"</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
  <span class="hljs-comment">&lt;!-- Header section --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">header</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>John's Portfolio<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">nav</span>&gt;</span>
      <span class="hljs-comment">&lt;!-- Add navigation links here if needed --&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">header</span>&gt;</span>

  <span class="hljs-comment">&lt;!-- Error section --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">section</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"error"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>Error<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"error-message"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h3</span>&gt;</span>Oops! Something went wrong.<span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>We apologize for the inconvenience. The page you are looking for cannot be found or is currently unavailable.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"index.html"</span>&gt;</span>Go back to the homepage<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">section</span>&gt;</span>

  <span class="hljs-comment">&lt;!-- Add more sections as needed (e.g., About, Contact, etc.) --&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"app.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p>Also use one profile.png picture for your website.</p>
<p>This website will be hosted publicly because its changing private to public in its main terraform file.</p>
<p>For more Information / Practice clone my Repo from GitHub :</p>
<p><a target="_blank" href="https://github.com/FaizanShaikh1/Terraform-lab-websitehosting-s3.git">https://github.com/FaizanShaikh1/Terraform-lab-websitehosting-s3.git</a></p>
<h2 id="heading-deploying-your-infrastructure"><strong>Deploying Your Infrastructure</strong></h2>
<p>Initialize your Terraform configuration by running:</p>
<pre><code class="lang-plaintext">terraform init
</code></pre>
<p>Now, apply the configuration:</p>
<pre><code class="lang-plaintext">terraform plan

# if all plan is correct ,go ahead and apply
terraform apply
</code></pre>
<p>Terraform will prompt you to confirm the creation of the resources. Type <code>yes</code> and hit Enter. Once the process is complete, you'll see the URL of your newly created S3 bucket.</p>
<h2 id="heading-uploading-your-website"><strong>Uploading Your Website</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705083589675/1820bf92-6f63-43ba-bb75-3b794b3c8152.png" alt class="image--center mx-auto" /></p>
<p>You can see your website by pasting URL on the browser.</p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>Congratulations! You've successfully set up a static website on AWS S3 using Terraform. This is a basic example, and you can further enhance it by adding features like CloudFront for CDN, custom domains, and more.</p>
<p>Terraform provides a powerful and declarative way to manage your infrastructure, making it easy to version, manage, and scale your web hosting infrastructure on AWS.</p>
<p>Happy coding and hosting!</p>
]]></content:encoded></item><item><title><![CDATA[Hosting Your Website on AWS: A Beginner's Guide]]></title><description><![CDATA[Are you a beginner eager to host your website on Amazon Web Services (AWS) in a simple and effective manner? Look no further! This guide will walk you through the process step-by-step, ensuring your website is up and running seamlessly. The best part...]]></description><link>https://skfaizan.hashnode.dev/hosting-your-website-on-aws-a-beginners-guide</link><guid isPermaLink="true">https://skfaizan.hashnode.dev/hosting-your-website-on-aws-a-beginners-guide</guid><category><![CDATA[AWS]]></category><category><![CDATA[AWSCommunity]]></category><category><![CDATA[website]]></category><category><![CDATA[webservice]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Devops articles]]></category><dc:creator><![CDATA[Faizan Shaikh]]></dc:creator><pubDate>Sat, 06 Jan 2024 11:00:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1704538231162/9a075ae7-03fa-4c76-b503-c6a168466e1a.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Are you a beginner eager to host your website on Amazon Web Services (AWS) in a simple and effective manner? Look no further! This guide will walk you through the process step-by-step, ensuring your website is up and running seamlessly. The best part? All you need is an AWS account!</p>
<h3 id="heading-overview"><strong>Overview:</strong></h3>
<p>This guide is tailored for beginners who wish to leverage AWS to host their websites effortlessly. By following these straightforward steps, you can have your website hosted in no time. The use of an AWS free tier account allows you to explore and deploy your website on an EC2 instance.</p>
<h3 id="heading-aws-ec2-instance"><strong>AWS EC2 Instance:</strong></h3>
<p>Step-by-step guide illustrate launching an Ubuntu instance on Amazon EC2:</p>
<ol>
<li><p><strong>Login to AWS Console:</strong></p>
<ul>
<li><p>Open the AWS Management Console: <a target="_blank" href="https://aws.amazon.com/">https://aws.amazon.com/</a>.</p>
</li>
<li><p>Sign in to your AWS account.</p>
</li>
</ul>
</li>
<li><p><strong>Navigate to EC2:</strong></p>
<ul>
<li>In the AWS Management Console, go to the "Services" dropdown and select "EC2" under the "Compute" section.</li>
</ul>
</li>
<li><p><strong>Launch an Instance:</strong></p>
<ul>
<li>Click on the "Launch Instance" button.</li>
</ul>
</li>
<li><p><strong>Choose an Amazon Machine Image (AMI):</strong></p>
<ul>
<li>In the "Choose an Amazon Machine Image (AMI)" step, select an Ubuntu AMI. Use the search bar to filter by entering "ubuntu."</li>
</ul>
</li>
<li><p><strong>Choose an Instance Type:</strong></p>
<ul>
<li>In the "Choose an Instance Type" step, select the instance type that meets your requirements (Free tier t2.micro). The default selection is usually a good starting point.</li>
</ul>
</li>
<li><p><strong>Configure Instance:</strong></p>
<ul>
<li>In the "Configure Instance" step, you can leave the default settings or customize them based on your needs.</li>
</ul>
</li>
<li><p><strong>Add Storage:</strong></p>
<ul>
<li>In the "Add Storage" step, specify the amount of storage you need for your instance. The default settings are typically sufficient for a basic setup.</li>
</ul>
</li>
<li><p><strong>Add Tags (Optional):</strong></p>
<ul>
<li>You can add tags to your instance for better organization (like practice). This step is optional.</li>
</ul>
</li>
<li><p><strong>Configure Security Group:</strong></p>
<ul>
<li>In the "Configure Security Group" step, configure the security group to allow incoming traffic. At least, allow SSH (port 22) for connecting to your instance. Optionally, allow HTTP (port 80) for web server access.</li>
</ul>
</li>
<li><p><strong>Review and Launch:</strong></p>
<ul>
<li>Review your configurations in the "Review Instance Launch" step. If everything looks good, click on the "Launch" button.</li>
</ul>
</li>
<li><p><strong>Select Key Pair:</strong></p>
<ul>
<li>In the "Select an existing key pair or create a new key pair" window, choose an existing key pair or create a new one. This key pair is necessary to connect to your instance securely.</li>
</ul>
</li>
<li><p><strong>Launch Instances:</strong></p>
<ul>
<li>Click on the "Launch Instances" button.  </li>
</ul>
</li>
</ol>
<p>Your Ubuntu instance is now launching. Once it's running, you can connect to it using SSH using the private key associated with the key pair you selected during the launch process or you can connect directly through aws console connect option.</p>
<h3 id="heading-screenshots"><strong>Screenshots:</strong></h3>
<p>Follows the screenshots for reference:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704535707654/62534fd1-f2d7-4d3e-ad81-0368697a408d.png" alt="search EC2 on the search bar" class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704535846197/87005d87-68c4-40f9-ad5d-a5d5e28f246c.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704535870684/843c22b7-4375-4a72-8d8b-869444d297a7.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704535992213/a48318a4-487e-4861-8e40-c611cc8ceeb6.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704536057228/42c80d29-fac2-4e16-81eb-4ad9261dfd3f.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704536065283/db25e428-d24b-40e8-acb8-70843f0eee38.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704536072381/90eb8611-7dc5-4743-858b-171768547f06.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704536078892/99d47f2f-e24c-4c82-9c21-a47dcf87590f.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704536085089/c88bbea8-3964-440f-9473-bce22570407b.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704536091266/090c481e-ee77-4061-8af0-4695df753a83.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704536097438/94a684f3-1f04-4d40-9165-48931e32c6ba.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704536108663/c9967367-6b11-40d6-a874-049ae00ad413.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704536114369/64488399-789f-476d-a28e-b3dd972b5a8f.png" alt class="image--center mx-auto" /></p>
<p><em><mark>Paste the public ip in the browser and access the website</mark></em></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704536120874/130163f3-bc57-442c-bddd-b7f191a10ae1.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704536143120/b5a922a7-9dc4-48e5-a644-cc5e2bb2aca6.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1704536152407/b74eb1f3-315f-4147-ad19-94e438bb4d81.png" alt class="image--center mx-auto" /></p>
<p><em><mark>Terminates the machines after completion.</mark></em></p>
<h3 id="heading-conclusion"><strong>Conclusion:</strong></h3>
<p>With this guide, even beginners can confidently host their websites on AWS. The use of an AWS free tier account ensures a cost-effective and risk-free environment to explore the powerful capabilities of cloud hosting. Follow these steps, and soon your website will be live, hosted securely on an AWS EC2 instance.</p>
<h3 id="heading-disclaimer"><strong>Disclaimer:</strong></h3>
<p>Always be mindful of AWS best practices and security measures to ensure a reliable and secure hosting experience.</p>
]]></content:encoded></item></channel></rss>