<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kabir Faqiri  on Medium]]></title>
        <description><![CDATA[Stories by Kabir Faqiri  on Medium]]></description>
        <link>https://medium.com/@faqirikabir7?source=rss-ff877e73920e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gqIp_4GZIvpha5L2</url>
            <title>Stories by Kabir Faqiri  on Medium</title>
            <link>https://medium.com/@faqirikabir7?source=rss-ff877e73920e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 09:42:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@faqirikabir7/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Deploying and Customizing an Ubuntu-Apache Docker Container]]></title>
            <link>https://aws.plainenglish.io/deploying-and-customizing-an-ubuntu-apache-docker-container-d568d2c3cb70?source=rss-ff877e73920e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d568d2c3cb70</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Kabir Faqiri ]]></dc:creator>
            <pubDate>Thu, 16 Nov 2023 00:43:43 GMT</pubDate>
            <atom:updated>2023-11-20T05:05:14.698Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fpmrscfcu4NSzL8OwJDpvg.jpeg" /></figure><p><em>Intro: </em>Welcome to “LaunchPad,” where we simplify web hosting using Docker, Ubuntu, and Apache2. Our project involves setting up a Docker container with Ubuntu, running on port 80. We’ll navigate through different Ubuntu images, update packages via BASH, install Apache2, and deploy a custom webpage. Finally, we’ll ensure our web server is accessible through a browser, demonstrating a seamless integration of these powerful technologies. Get ready to dive into a streamlined journey of web server deployment!</p><p>Prerequisite: You need an AWS Ubuntu EC2 instance Free-tier will do the job.</p><p><strong>Step1</strong>: Create an EC2 instance as below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Qcs-O14zXIIY4_Ekov-qA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5QQypNL0yEAe_AInLwVuaA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XRLBwpno4MwMVCPLp8zAmQ.jpeg" /></figure><p><strong>Step2</strong>: Connect to the EC2 instance by SSH or EC2 Instance Connect and run “sudo su” command to run root commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jCARGvuCPdXaiRow9bChOA.png" /></figure><p><strong>Step3:</strong> Now lets install docker on our EC2 instance by installing updates first and then install docker and finally check if the docker is installed successfully.</p><pre>## install updates on the system by running <br>apt-get update</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dHnsKDerpCZCDHZoaPnvnw.png" /></figure><pre>## Now install docker by this running <br>apt install docker.io -y </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pxp1aKSVdhNx1KW3eZx_mA.png" /></figure><pre>## now check if docker installed on the system by running.<br>## As below, the docker is installed on the EC2 instane.<br>docker version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lgeyKip8guUvXvKrV_lIag.png" /></figure><p><strong>Step4:</strong> We are going to dun a Docker Ubuntu container running detached and on port 80. We successfully achieved this as shown below.</p><pre>## we can create a docker container with ubuntu image in detached mode <br>## on port 80 by running this command<br>## you might have a question that we didnt pull ubuntu image first. <br>## If you run a container with the image that hasnt been pulled yet docker itself is going to pull the image and run the container as well.<br>docker container run -it -d -p 80:80 ubuntu <br>## we can see the containers by running this command <br>docker ps <br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5I5RpsNcDcq8D5k8dElRmw.png" /></figure><p><strong>Step5</strong>: Now we are going to go inside the container, install updates, and finally install apache2, enable it and customize our index.html file.</p><pre>## we can go inside the contianer by running this command <br>## use docker container ID or name and select bin or bash but for this project we will go with Bash<br>docker exec -it (containerID/Name) (bash/bin)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ELSOszbhGFOmC6XuXLvpPg.png" /></figure><pre>## Using BASH shell we will update all packages within the container by running. <br>apt-get update <br>## Using BASH we will install Apache2 on the Ubuntu container by running <br>apt install apache2 -y <br>## now start the apache2 service by running <br>service apache start<br>## Also we will install vim to use VI editor by running this command <br>apt install vim -y <br>## we will change the directory to /var/www/html to acces index.html by runnning <br>cd /var/www/html<br>## vi to the index.htmml file and delete the existing code and paste your new cod<br>## and to exit and save click :wq! and enter <br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xp1Ud9hEgLfEwbiB7ctBlA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gdn-2Fh-6HoS2k24QtZd0Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E_Hm5Mzh2hu3IqeOZZQJLg.png" /></figure><p><strong>Step6:</strong> We are going to verify our work by copying the public IP of our EC2 instance and paste it to a new browser tab. Lets dont forget this after pasting the public ip put (:) and put the port you mapped it to which is (80), so you IP address should look like this (54.234.72.237:80) as shown below our company website (LaunchPad) is running on a docker container on port 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xn4mPpJmImRYScXlHksy9w.png" /></figure><p>Thank you so much for following this long. If you want to catch my other quality Docker, Kubernetes, AWS cloud, and over DevOps practice. Follow me on <a href="https://medium.com/@faqirikabir7">Medium</a> and <a href="https://www.linkedin.com/in/kabirfaqiri/">LinkedIn</a>.</p><h3><a href="https://plainenglish.io/">PlainEnglish.io</a> 🚀</h3><p><em>Thank you for being a part of the In Plain English community! Before you go:</em></p><ul><li><em>Be sure to </em><strong><em>clap</em></strong><em> and </em><strong><em>follow</em></strong><em> the writer</em><strong>️</strong></li><li><em>Learn how you can also </em><a href="https://plainenglish.io/blog/how-to-write-for-in-plain-english"><strong><em>write for In Plain English</em></strong></a><em>️</em></li><li><em>Follow us: </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>X</em></strong></a><strong><em> | </em></strong><a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><strong><em> | </em></strong><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><strong><em> | </em></strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong><em>Discord</em></strong></a><strong><em> | </em></strong><a href="https://newsletter.plainenglish.io/"><strong><em>Newsletter</em></strong></a></li><li><em>Visit our other platforms: </em><a href="https://stackademic.com/"><strong><em>Stackademic</em></strong></a><strong><em> | </em></strong><a href="https://cofeed.app/"><strong><em>CoFeed</em></strong></a><strong><em> | </em></strong><a href="https://venturemagazine.net/"><strong><em>Venture</em></strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d568d2c3cb70" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/deploying-and-customizing-an-ubuntu-apache-docker-container-d568d2c3cb70">Deploying and Customizing an Ubuntu-Apache Docker Container</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated Directory Profiler: Extracting File Metadata in Python ]]></title>
            <link>https://towardsaws.com/automated-directory-profiler-extracting-file-metadata-in-python-14ed03829b90?source=rss-ff877e73920e------2</link>
            <guid isPermaLink="false">https://medium.com/p/14ed03829b90</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[script]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Kabir Faqiri ]]></dc:creator>
            <pubDate>Tue, 17 Oct 2023 21:28:14 GMT</pubDate>
            <atom:updated>2023-10-27T04:51:54.115Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LADQEpiMPfGADOaJBr3FQQ.jpeg" /></figure><p><strong><em>Intro:</em></strong><em> </em>In today’s data-centric world, understanding the digital landscape is crucial. As companies scale and adapt, the sheer volume of files and data they manage can become overwhelming. Enter the realm of automation — a tool every modern company employs to remain agile and informed. 🐍</p><p>For our latest venture, we’ve harnessed the power of Python. This nifty tool delves into the heart of a machine’s current working directory, meticulously extracting essential metadata from each file. Whether it’s the name, size, or type, our script gathers it all and neatly organizes the information into a list of dictionaries. This not only provides a comprehensive snapshot of the directory’s content but also offers valuable insights that can inform storage decisions, optimize file management, and enhance data security protocols. Dive in as we explore how this Python-driven solution is changing the way we view and manage our files.</p><p><strong><em>Scenario:</em></strong> Your company needs to learn about the files located on various machines. You have been asked to build a script that extracts information such as the name and size about the files in the current working directory and stores it in a list of dictionaries.</p><p><strong>Note: In order for you to learn and follow this code I explained this Python project in 4 steps. So lets get started!</strong></p><h4><strong><em>Dictionaries in Python🐍: Key to this project</em></strong></h4><p>In Python, dictionaries are versatile data structures that store data in key-value pairs. Imagine them as mini databases, where you have a ‘key’ (akin to a question) and a ‘value’ (the answer to that question). For our project, dictionaries are invaluable. Each file’s metadata, like its name or size, is stored in such a pair:</p><pre>file_metadata = {&quot;PATH&quot;: &quot;/path/to/file&quot;, &quot;SIZE&quot;: 12345}</pre><p>This approach not only organizes our data efficiently but also offers a scalable solution for adding more file attributes in the future.</p><h4><strong>Using AWS Cloud9 as the IDE for Our Project</strong></h4><p>For this project, I’ve chosen Cloud9 as the IDE. Its cloud-based features and user-friendly interface make Python development smooth and efficient, ensuring the best coding experience.</p><p><strong>Step 1: </strong>Setting the Environment and Importing Modules. The first line ensures the script runs using Python 3.7. Next, we import two modules: os (for interacting with the operating system) and glob (for pathname pattern expansion). As shown in the below code.</p><pre>#!/usr/bin/env python3.7<br>import os<br>import glob</pre><p><strong>Step 2: </strong>Defining the Function to Fetch File Information. This function, get_files_with_sizes, takes a directory path as its argument. It returns a list of dictionaries where each dictionary contains the path and size of a file. We ensure we&#39;re only working with files and not directories by using os.path.isfile. As shown in the below code.</p><pre>def get_files_with_sizes(directory_path):<br>    return [<br>        {&quot;PATH&quot;: file, &quot;SIZE&quot;: os.path.getsize(file)} <br>        for file in glob.glob(directory_path + &#39;/*&#39;) <br>        if os.path.isfile(file)<br>    ]</pre><p><strong>Step 3: </strong>The Main Function. The main function first retrieves the current working directory using os.getcwd(). It then uses the previously defined function to get a list of dictionaries containing file information. Finally, it loops through this list and prints each dictionary. As shown in the below code.</p><pre>def main():<br>    cwd_path = os.getcwd()<br>    cwd_path_files = get_files_with_sizes(cwd_path)<br>    <br>    for file_info in cwd_path_files:<br>        print(file_info)</pre><p><strong>Step 4: </strong>Script Execution Control. This construct ensures that if this script is imported as a module in another script, the main function won&#39;t run automatically. However, if the script is executed directly, the main function will run, executing the logic we&#39;ve defined. As shown in the below code.</p><pre>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p><strong>Note:</strong> In order to test if this python script is working you need some dummy files in your directory so the script list them.</p><p><strong>Test1:</strong> As shown below on the terminal, you can see that I have some files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q2bbBinCpVYH6ZUiwDaHLg.png" /></figure><p><strong>Test2:</strong> Lets run the python script and see if its listing our files. As shown below, we can successfully run the script and its listing the file based on the path, size, and file name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sGb7fKxgj97C2eZst4BGmw.png" /></figure><p>Thank you so much for following along this python automation project. For more upcoming python automation scripts in DevOps and Cloud please follow me on <a href="https://www.linkedin.com/in/kabirfaqiri/">LinkedIn</a>, <a href="https://medium.com/@faqirikabir7">medium</a> and you can access this project in my Github repository <a href="https://github.com/kaf23466/Generate-list-of-dictionaries">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14ed03829b90" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/automated-directory-profiler-extracting-file-metadata-in-python-14ed03829b90">Automated Directory Profiler: Extracting File Metadata in Python 🐍</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DynamoDB & EC2 Integration: A Hands-on Guide]]></title>
            <link>https://aws.plainenglish.io/dynamodb-ec2-integration-a-hands-on-guide-cfca48232503?source=rss-ff877e73920e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfca48232503</guid>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[iam-roles]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Kabir Faqiri ]]></dc:creator>
            <pubDate>Sun, 10 Sep 2023 20:08:00 GMT</pubDate>
            <atom:updated>2023-09-12T01:14:56.389Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kYKPU8xg36AVNweBxtu92g.jpeg" /></figure><p>Embark on a journey through the AWS landscape! 🖥️ Construct a dynamic table, fill it with pertinent data, and utilize the strength of EC2! 📊✨ Master permissions and amplify your abilities with this challenge! Ready to elevate your AWS mastery? 🚀📚</p><blockquote>Project Scenario:</blockquote><p>We aim to create a DynamoDB table titled “Top Rated Movies” and populate it with details of 10 best movie releases. Following this, we will launch a `t2.micro` EC2 instance. For security, an IAM role will be assigned to the instance, ensuring it only has read permissions to the DynamoDB table, adhering to the principle of least privilege. Utilizing the AWS CLI within the EC2 instance, we will validate our ability to scan the table for entries and confirm our inability to add new items to the table. The movie listings in the table are to be sorted based on their IMDb ratings.</p><p><strong>Step1</strong>: Head over to DynamoDB on your AWS search bar and click on “<strong>DynamoDB</strong>” and then click on “<strong>Create table</strong>” as shown below on page 1,2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w90DaVT23GSl67YPQPMxVw.jpeg" /></figure><p>Name your table and then put the two partition keys for your table, then you can edit it later to your demand. Choose “<strong>Customize settings</strong>” so we can configure our table. Choose “<strong>DynamoDB Standard</strong>” for the class of storage. We will choose “<strong>On-demand</strong>” for our read and write capacity. Remember DynamoDB charger you money based on the Read/Write. As shown on page 3,4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PqYVxF5HjPrIn9edDOh8Pg.jpeg" /></figure><p>Also, we choose “<strong>Owned by Amazon DynamoDB</strong>” by default and click on “<strong>Create table</strong>” then click on the table “<strong>TopMovies</strong>” and then click on “<strong>Create item</strong>” based on page 5,6.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cvymKmoKSYLj07rjZAd0ug.jpeg" /></figure><p>Now we are going to edit the table based on our needs. Based on page 7 you can click on “<strong>Add new attribute</strong>” and attributes in this project I just need strings. After selecting attributes for Movie title, genre, release year and IMDb rating you can go ahead click on “<strong>Create item</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8erN87aW9y_LgXvE1Jrd2g.jpeg" /></figure><p>You can add the first movies with the process of adding the attributes and then click on “<strong>Create item</strong>” and takes too much time for adding 10 movies so we will use the “<strong>JSON view</strong>” make the process easy. Click on “<strong>JSON view</strong>” copy the JSON code and input the movie name, genre, IMDb Rating, and Release Year in the code.</p><pre>{<br>  &quot;Title &quot;: {<br>    &quot;S&quot;: &quot;Inception&quot;<br>  },<br>  &quot;Genre&quot;: {<br>    &quot;S&quot;: &quot;Sci-Fi&quot;<br>  },<br>  &quot;IMDb Rating &quot;: {<br>    &quot;S&quot;: &quot;8.8&quot;<br>  },<br>  &quot;Release Year&quot;: {<br>    &quot;S&quot;: &quot;2010&quot;<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DUUuXYW6k_--Bqyhnxf2Sw.jpeg" /></figure><p><strong>Step2:</strong> Now we are going to create an IAM role for the DynamoDB table and the permission is ReadOnlyAccess. Go to IAM and click on “<strong>Roles</strong>” and then click on “<strong>Create role</strong>” click on “<strong>AWS service</strong>” click on EC2 on the drop down and click on “<strong>EC2</strong>” and then “<strong>Next</strong>” based on page 11,12,13.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pfgEKjUncxdiLXQWRY2Xvw.jpeg" /></figure><p>Search for “<strong>AmazonDynamoDBOnlyAccess</strong>” select and click “<strong>Next</strong>” Name your role and click on “<strong>Create role</strong>” based on page 14,15.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f1V6Y8L_UAnp8o5mUOHxNA.jpeg" /></figure><p><strong>Step3:</strong> We are going to create an EC2 instance to access our DynamoDB table. You need to install AWS Cli into your EC2 instance. So you need to follow the steps on page 16 and 17 as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QIMojezEKzOMlKjAMT2yow.jpeg" /></figure><p>Now after the creation of our EC2 instance we will assume the DynamoDB ReadOnlyAccess role by the EC2 instance as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_h7mpuiWwgaeTZTywENbvw.jpeg" /></figure><p>Based on page 18,19, we need to connect to our EC2 instance and install AWS Cli on it. You visit the AWS CLI installation official documentation for Linux OS <a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-idInbhZrOyryR2w6myatA.jpeg" /></figure><p><strong>Step3:</strong> After the creation of the EC2 instance and instillation of AWS Cli on it, we will run the below commands to see if we are connected to our AWS account and scan the DynamoDB table. Based on pages 22,23</p><pre>##run this command to make sure your are connected with your AWS account thorugh the CLI<br>aws sts get-caller-identity <br>##run this command to scan the DynamoDB Table your created <br>aws dynamodb scan --table-name TopMovies <br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1sKulpk8JJvCjE3HQLK4VQ.jpeg" /></figure><p>Finally, we need to run a command to make sure if we cannot edit or add an item to our DynamoDB table. Since we assumed the ReadOnlyAccess by the EC2 instance, we shouldn&#39;t be able to add an item to our table because of the role we assumed. As shown below, we got the “AccessDeniedException” which means the process was successful.</p><pre>##I run this command to add a new movie in my list<br>aws dynamodb put-item --table-name TopMovies --region us-east-1 --item &#39;{<br>  &quot;Title &quot;: {<br>    &quot;S&quot;: &quot;Inception&quot;<br>  },<br>  &quot;Genre&quot;: {<br>    &quot;S&quot;: &quot;Sci-Fi&quot;<br>  },<br>  &quot;IMDb Rating &quot;: {<br>    &quot;S&quot;: &quot;8.8&quot;<br>  },<br>  &quot;Release Year&quot;: {<br>    &quot;S&quot;: &quot;2010&quot;<br>  }<br>}&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*15ljAEjuuQ0G5KnNF8YOKg.jpeg" /></figure><p>Thank you so much for reading and working on this project&gt; Please follow for more if you want to get notified to next AWS Cloud project in DevOps culture.</p><h3>In Plain English</h3><p><em>Thank you for being a part of our community! Before you go:</em></p><ul><li><em>Be sure to </em><strong><em>clap</em></strong><em> and </em><strong><em>follow</em></strong><em> the writer! 👏</em></li><li><em>You can find even more content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><strong><em> 🚀</em></strong></li><li><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. 🗞️</em></li><li><em>Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a><strong><em>(X</em></strong>), <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a>, <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a>, and <a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfca48232503" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/dynamodb-ec2-integration-a-hands-on-guide-cfca48232503">DynamoDB &amp; EC2 Integration: A Hands-on Guide</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Future of Scalable Cloud Architecture: The Ultimate VPC Project]]></title>
            <link>https://aws.plainenglish.io/unlocking-the-future-of-scalable-cloud-architecture-the-ultimate-vpc-project-51956fe44868?source=rss-ff877e73920e------2</link>
            <guid isPermaLink="false">https://medium.com/p/51956fe44868</guid>
            <category><![CDATA[subnet]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[vpc]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Kabir Faqiri ]]></dc:creator>
            <pubDate>Mon, 04 Sep 2023 20:25:29 GMT</pubDate>
            <atom:updated>2023-09-05T00:30:09.328Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xx3x0_rcr9PWV2gAx490jw.jpeg" /></figure><p><strong><em>Intro:</em></strong> In this exciting project, we’ll set up a secure Virtual Private Cloud (VPC) using a 10.10.0.0/16 CIDR, carve out three specialized public Subnets, and deploy an Autoscaling group of t2.micro instances with custom Apache web pages. With Application Load Balancer in the mix and airtight security measures, we’re creating a resilient, scalable, and secure environment accessible only through our load balancer. Lets unleash your inner cloud architect and redefine what’s possible with VPCs, Subnets, Autoscaling, and load balancing! <strong>🌩️. </strong>Dive in and get hands-on experience like never before!</p><p><strong>Scenario:</strong> Imagine you’re a Cloud Engineer at Skyward Technologies. Your challenge: Create a fail-safe cloud infrastructure for Apache Web Servers, ensuring at least two servers are always active.Are you up for the challenge? 💡</p><p><strong>S1Step1: </strong>Create a VPC with CIDR range of 10.10.0.0/16. As shown below click on “<strong>VPC</strong>” and then click on “<strong>Create VPC.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N8XWQwljrZ7WWsEcZPFC3Q.jpeg" /></figure><p><strong>S1Step2:</strong> Click on “<strong>VPC only</strong>”, name your VPC choose “<strong>IPv4 CIDR manual input</strong>.” Now we will input the IPv4 CIDR which is 10.10.0.0/16. Choose “<strong>No IPv6 CIDR block</strong>” finally click on “<strong>Create VPC.” </strong>Based on page 4 on the left pane click on “<strong>Subnets</strong>” and then click on “<strong>Create subnet”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WQYUE8jEeehpDCH9NwW3cA.jpeg" /></figure><p>Now we Create three public Subnets with 10.10.1.0/24 &amp; 10.10.2.0/24 &amp; 10.10.3.0/24 range. Choose the VPC you just created. Make sure you create each Subnet in us-east-1a, us-east-1b and us-east-1c. Then click on “<strong>Create subnet</strong>”. Repeat the process in page 5 for the other two Subnets. As shown on page 6 we successfully created the Subnet we are not done yet tho.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Be19TGXWUqzCnHoXiWfgGg.jpeg" /></figure><p>Now we need to “<strong>Enable auto-assign public IPv4 address</strong>” then click “<strong>save</strong>” and repeat this process for the other 2 Subnets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GtpdZ2Tb5LrSOUMSORAs4A.jpeg" /></figure><p><strong>S1Step3</strong>: On the left pane click on “<strong>internet gateways</strong>”, click on “<strong>Create internet gateway</strong>”, name your IGW and then click on “<strong>Create internet gateway”. </strong>As shown on page 7 and 8.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gVOJrPmLWPxRSto8rpVjQA.jpeg" /></figure><p>Now we need to to Attach our IGW to the VPC we created as shown on page 9 and 10 click on “<strong>Actions</strong>” then click on “<strong>Attach to VPC</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lclki5w2GTotmJ0vX_bmxg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vh2Kcf0EAWMxLq3lhXQM0g.jpeg" /></figure><p><strong>S1Step4</strong>: On the left pane click on route tables and then click on “<strong>Create route table</strong>” then name your route table, choose your VPC and then click on “<strong>Create route table</strong>” as shown on page 12 and 13.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VFBW2rjitmxuPRsE9-BAKQ.jpeg" /></figure><p>Also we need to associate the three subnets that we created click on “<strong>Edit subnet associations</strong>” choose the subnets and click on “<strong>save</strong>” then click on “<strong>Edit routes</strong>” choose 0.0.0.0/0 choose internet gateway and then choose the internet gateway that you recently created for this project. Then click on “<strong>Save changes.”</strong> As shown on page 14,15,16.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EcueiNtw8S0chb-8q4w9fQ.jpeg" /></figure><p><strong>S1Step5:</strong> We will create an autoscalling group using t2.micro instances and we will install apache on them by using user data field. We will ensure that we utilize our public subnets that we just created. Click on “<strong>Auto Scaling groups</strong>” and then click on <strong>“Create Auto Scaling group</strong>” and then click on “<strong>Create a launch template</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJ9Y2UikryWupMQAKajKpQ.jpeg" /></figure><p><strong>S1Step6</strong>: We are going to create a launch template. Basically we are creating an EC2 instance with apache installed on it. As shown on page 20 name your template click on “<strong>Quick Start</strong>” stay in Free-tier. Create a “<strong>key-pair</strong>” “<strong>.pem</strong>” file. Now as shown on page 21 click on Create a security group to create one. Name your security group choose the VPC we created add security group rules so we can access it on web or if we want to SSH to our machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oWE1X2ky3x8VadRTzT-lww.jpeg" /></figure><p>Now copy and paste below commands to the user data field so we have apache installed in our instances. Then click on “<strong>Create launch template</strong>”</p><pre>#!/bin/bash<br>apt-get update -y<br>apt-get install -y apache2<br>systemctl start apache2<br>systemctl enable apache2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v8ITrVQKX1ffjihQ4g-TEQ.jpeg" /></figure><p><strong>S1Step7</strong>: Now we are going to create an auto scaling group with the template we just created. As shown on page 23, 24. Name your ASG select the template you just created and click “<strong>Next</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Q-GnAPssUoD1Mh9tfnEpg.jpeg" /></figure><p>As shown on page 25 select the VPC that we created and select the subnets in all availability zones. and click “<strong>Next</strong>” On page 26 we need to create load balancer click on “<strong>Attach to a new load balancer</strong>”, select “<strong>Application Load Balancer</strong>”, name the LB select the “<strong>Internet-facing</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O1YrTUm3QGd9m7ZhwO_PVw.jpeg" /></figure><p>Now as shown on page 27 select the “<strong>No VPC Lattice service</strong>”, then click on “<strong>Turn on Elastic Load Balancing health checks</strong>” , then “<strong>Enable group metrics collection within CloudWatch</strong>” and then click on “<strong>Next</strong>” then per page 28 input 2 on “<strong>Desired capacity</strong>”, input 2 on “<strong>Minimum capacity</strong>” finally input 5 on “<strong>Maximum capacity</strong>” and then click on “<strong>Next</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wDq_U9m5AZ-nKgUuFgGEog.jpeg" /></figure><p>On page 29 click on activity you can see that our ALB is successfully created. On page 30 you can see that the LB works fine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dvBJBIqfqFxdEvi99opMYQ.jpeg" /></figure><p><strong>S1Step8</strong>: We can verify that we can access our webserver by the Load Balancer DNS. As shown below, since we have 2 instances as you refresh the load balancer switches to the other EC2 instance which you can see that one instance is Ubuntu Apache welcome page and the other one is my Name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FA84zCYkkTWCkMQo3gI_yw.jpeg" /></figure><p><strong>S1Step9</strong>: Per the project requirements we need to make sure that we cant access our webserver by our public IP. We need to access the webserver by load balancer’s DNS only. In order to do that we need to create another security group and give HTTP inbound rule to it and then go to the security group of our load balancer and delete the HTTP rule and add the security group that we recently created. As shown below I can only access the webserver through the LB DNS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dDTLgKaWiRZsYYKOqcukKg.jpeg" /></figure><p>Thank You so much for reading and following the project. Please follow me to always get notified for the future Cloud/DevOps projects.</p><h3>In Plain English</h3><p><em>Thank you for being a part of our community! Before you go:</em></p><ul><li><em>Be sure to </em><strong><em>clap</em></strong><em> and </em><strong><em>follow</em></strong><em> the writer! 👏</em></li><li><em>You can find even more content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><strong><em> 🚀</em></strong></li><li><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. 🗞️</em></li><li><em>Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a><strong><em>(X</em></strong>), <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a>, <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a>, and <a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51956fe44868" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/unlocking-the-future-of-scalable-cloud-architecture-the-ultimate-vpc-project-51956fe44868">Unlocking the Future of Scalable Cloud Architecture: The Ultimate VPC Project</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS EC2 Mastery Project]]></title>
            <link>https://aws.plainenglish.io/aws-ec2-mastery-project-28569a556f54?source=rss-ff877e73920e------2</link>
            <guid isPermaLink="false">https://medium.com/p/28569a556f54</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cli]]></category>
            <dc:creator><![CDATA[Kabir Faqiri ]]></dc:creator>
            <pubDate>Sun, 27 Aug 2023 18:23:00 GMT</pubDate>
            <atom:updated>2023-09-05T00:29:57.131Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DJgDzYrFWOgAweAH5whMlA.jpeg" /></figure><p><strong><em>INTRO:</em></strong> Begin with establishing a foundational EC2 instance and automating Apache installation. Next, in our advanced phase, craft and relaunch an AMI, ensuring seamless web access. Gear up for a concise yet comprehensive dive into AWS expertise! 🚀🔍🌍</p><p><strong>Segment1:</strong> In this segment of the project we will learn how to setup an EC2 instance, install updates, and install Apache on it by using a script on the user-data field. Finally, we will verify if the segment is successful.</p><p><strong>S1Step1</strong>: Per page one search for “<strong>EC2</strong>&quot; and click on it. Per page 2 click on “<strong>Launch instance</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c9g5caG08wMvdvV8BgW8pA.jpeg" /></figure><p><strong>S1Step2</strong>: Name your EC2 instance. Choose Ubuntu AMI and stay in free-tier. Per page 4 create the key-pair name it, click on “<strong>RSA</strong>” select “<strong>.pem</strong>” and click on “<strong>Create key pair</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5QQypNL0yEAe_AInLwVuaA.jpeg" /></figure><p><strong>S1Step3</strong>: As shown on page 5 select the key-pair. Make sure to enable “<strong>Auto-assign public IP.</strong>” In the security part I assume that you already created a WebAccess which you open HTTP and HTTPS to access web. Per page 6 scroll down and in the user-data field we will write an script for updating install Apache, enabling and starting the Apache. Below is the script. Finally click on “<strong>Launch instance</strong>.”</p><pre>#!/bin/bash<br>apt-get update -y<br>apt-get install -y apache2<br>systemctl start apache2<br>systemctl enable apache2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1lyld30r_xHm0PmSlWTmaw.jpeg" /></figure><p><strong>S1Step4</strong>: Per page 7 as we see that the instance is running and we need to copy the “<strong>Public IPv4 address</strong>” and paste and run it on a new window. As shown on page 8 we can access our Apache server and the operation is been successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4LN-g_j15Y-SidWQYLZtRA.jpeg" /></figure><p><strong>Segment2</strong>: In this segment of the project we will create an AMI of the instance Why do this? Creating an AMI of your EC2 instance allows for rapid replication of your server setup and acts as a backup for disaster recovery. It facilitates efficient scaling, migration, and versioning, streamlining AWS infrastructure management.</p><p><strong>S2Step1</strong>: Per page 9 right click on the instance and click on “<strong>Image and templates</strong>” and then click on “<strong>Create Image</strong>.” Name your image and keep the rest at default. Then click on “<strong>Create image.</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXd-kEvGrzLdl0hePs5XmQ.jpeg" /></figure><p><strong>S2Step2</strong>: Click on “<strong>AMIs</strong>” I named my “<strong>ubuntu Apache</strong>”, click on “<strong>Launch instance from AMI</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*486iX3-Y0pEHO_LKFvockQ.jpeg" /></figure><p><strong>S2Step3</strong>: so, it here we are just trying to launch an EC2 isntance from our AMI image. Per page 11 name your instance. Scroll down select your key-pair choose security group allowing WebAccess. Then click on “<strong>Launch instance</strong>” per page 12.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xs3zkkoxEuA1y2Rj9e_vtQ.jpeg" /></figure><p><strong>S2Step4:</strong> Select the newly created EC2 instance copy the “<strong>Public IPv4 address</strong>.” Past and go the IP on a new window. Per page 14 our EC2 instance is working successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nkVptMev-FVIqy0Xy9oNXQ.jpeg" /></figure><p>Please follow for more Quality AWS Cloud/DevOps projects that can help you learn.</p><h3>In Plain English</h3><p><em>Thank you for being a part of our community! Before you go:</em></p><ul><li><em>Be sure to </em><strong><em>clap</em></strong><em> and </em><strong><em>follow</em></strong><em> the writer! 👏</em></li><li><em>You can find even more content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><strong><em> 🚀</em></strong></li><li><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. 🗞️</em></li><li><em>Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a><strong><em>(X</em></strong>), <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a>, <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a>, and <a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28569a556f54" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/aws-ec2-mastery-project-28569a556f54">AWS EC2 Mastery Project</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux User and Directory Management from Basic to Automation]]></title>
            <link>https://medium.com/@faqirikabir7/linux-user-and-directory-management-from-basic-to-automation-b2391925195b?source=rss-ff877e73920e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2391925195b</guid>
            <category><![CDATA[linux-tutorial]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[administration]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Kabir Faqiri ]]></dc:creator>
            <pubDate>Mon, 21 Aug 2023 01:05:08 GMT</pubDate>
            <atom:updated>2023-08-21T01:05:08.907Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nb2ydImUVaXho41iQ-6xNw.png" /></figure><p><strong><em>Intro:</em></strong></p><p>In the realm of Linux, precise management of users and directories is crucial for security and efficiency. This project provides a step-by-step guide, beginning with fundamental tasks like creating users and groups, and culminating in automating these processes with bash scripting. Dive in to master the art of Linux permissions and streamline administrative tasks. Suppose you are a Linux admin in Skyward Technologies and you are tasked to do below tasks.</p><p><strong><em>Prerequisites:</em></strong> For this project we will be working with Ubuntu Linux and the easy way to get access to an Ubuntu machine is AWS Cloud. So lets create our Ubuntu Free-Tier Linux instance.</p><p>Login to your AWS console search for EC2 Click on “EC2”, then click on “Launch instance” as show on page 1,2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qd6P8JeFN3o7H-22nTQBIw.jpeg" /></figure><p>Name your instance select “<strong>Ubuntu</strong>” from the Quick Start AMI section. For this project we only need Free-tier image. Then I created a <strong>RSA</strong> (<strong>.pem</strong>) key and selected it. Make sure you Enable “<strong>Auto-assign public IP</strong>” then I selected my WebAccess security group even tho I don&#39;t need HTTP for now but you never know we might need it. Leave the rest at “<strong>Default</strong>” and click on “<strong>Launch instance</strong>” As shown in page 3,4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6AIpt_0Vlr9BOdJbtRs9cA.jpeg" /></figure><p>Now as shown in page 5 that our instance is running successfully we have public ip and now click on “Connect” so we SSH to our terminal. Click on “SSH Client” as shown on page 6. Then open your terminal in your local computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-sgOzKL01tJ1m4mZBl0Xiw.jpeg" /></figure><p>As shown on page 7 when opened terminal and we need the below commands to SSH. After following the below steps we are read to interact with Linux and start our project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OmrwD6BfveLL85LCq-BMaQ.jpeg" /></figure><pre>##As you opened the terminal you need to switch to root user by running and input your password<br>sudo su <br>##After inputting your password change your working directory to downloads because our key pair is in this directory by running<br>cd downloads <br>##Now we will run the command that we copied from page 6 <br>ssh -i &quot;ubuntukey.pem&quot; ubuntu@ec2-100-24-126-202.compute-1.amazonaws.com<br>##the shell will ask to confirm if you want to connect so input<br>yes<br>##Now we successfully SSHed to our instance by our local terminal</pre><p><strong>Step 1:</strong> Create 3 directories: Development, Operations, Analytics and add several files to each directory. Note: before you perform these tasks create a separate directory for your project as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zExn_gYj8mexa5u14SQq4w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c6d7V9uG3u4v6zll0ANkHw.jpeg" /></figure><p><strong>Step 2: </strong>Create 3 Groups in Linux: Developers, Operations, Data Analyst. Each group should only have view and access to their respective directory. Change the owner of each directory to their respective group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3cAGBlpgGqUpxPrih992iQ.jpeg" /></figure><p>Note: use (getent group) to verify the creation of the groups. Scroll down you will see them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*FUlDts6TP7mQqWo8ebAfBA.jpeg" /></figure><p><strong>Step 3:</strong> Modify the permissions to the directory so that only the owner of the group can read, write and execute. Users should not be able to access the directory if they are not in the correct group. You can see on page 1 that our the owners are all root user we want to associate the correct directories to the groups as shown on page 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXb30-7vt8-DJB6e7IE03A.jpeg" /></figure><p>Now we want to give permissions of these users and groups. And you can verify the permissions back like I did below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vbN8DJK08G2-3_4IFFDR1A.jpeg" /></figure><p><strong>Step 4: </strong>Create the following users with the associated information. Please follow as shown below to create the users and add them to the group.</p><p>a. NameL Jess Waller, username= jwaller, <a href="/service/mailto:email=jwaller@xn--levelupbank-6d3f.com">email=jwaller@‌</a>skywardtech.com, group= Developers</p><p>b. Name: Blake Dorsey, username= bdorsey, <a href="/service/mailto:email=bdorsey@xn--levelupbank-6d3f.com">email=bdorsey@‌skywardtech.com</a>, group= Operations</p><p>c. Name: Joey Ewart, username= jewart, <a href="/service/mailto:email=jewart@levelupbank.com">email=jewart@skywardtech.com</a>, group= Data Analysts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8EnXJp2S7iHp1Q5I_x-tAg.jpeg" /></figure><p><strong>Step 5:</strong> Log in as each user to ensure they can only access their assigned directory and view its files as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*df-i-RZdQs58WxHonnv1Cw.jpeg" /></figure><p><strong>Step 6</strong>: We’re now venturing into creating a bash script to seamlessly automate all these tasks. Harnessing the power of scripting, we aim to streamline our workflow and ensure consistency throughout. For this step I will terminate the current instance and create another one so instance is fresh for the script to be ran. Below is the script for this process.</p><pre>#!/bin/bash<br><br># Ensure the script is run as root<br>if [ &quot;$(id -u)&quot; -ne 0 ]; then<br>    echo &quot;Please run as root&quot;<br>    exit 1<br>fi<br><br># Create directories<br>mkdir Development Operations Analytics<br><br># Add dummy files<br>touch Development/file1 Development/file2<br>touch Operations/file1 Operations/file2<br>touch Analytics/file1 Analytics/file2<br><br># Create groups<br>groupadd Developers<br>groupadd Operations<br>groupadd Data-Analysts<br><br># Set directory ownership<br>chown :Developers Development<br>chown :Operations Operations<br>chown :Data-Analysts Analytics<br><br># Set directory permissions<br>chmod 770 Development<br>chmod 770 Operations<br>chmod 770 Analytics<br><br># Create users. Ubuntu typically uses the adduser command instead of useradd for a friendlier interface<br>adduser --shell /bin/bash --gecos &quot;Jess Waller,jwaller@skywardtech.com&quot; --ingroup Developers jwaller --disabled-password<br>adduser --shell /bin/bash --gecos &quot;Blake Dorsey,bdorsey@skywardtech.com&quot; --ingroup Operations bdorsey --disabled-password<br>adduser --shell /bin/bash --gecos &quot;Joey Ewart,jewart@skywardtech.com&quot; --ingroup Data-Analysts jewart --disabled-password<br><br># Inform about setting passwords<br>echo &quot;For security, consider setting passwords for the new users using the passwd command.&quot;<br><br># Set permissions for users to view only their own profile<br>chmod 700 /home/jwaller<br>chmod 700 /home/bdorsey<br>chmod 700 /home/jewart<br><br>echo &quot;Setup Complete&quot;</pre><p><strong>A.</strong> Create a script file as shown below. I will use Vi editor. Copy and past the bash script to the editor and close and save by press<strong> ESC</strong> key and inputting <strong>wq!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D6pTsf6p7QITjUYX9N_pEg.png" /></figure><p><strong>B. </strong>Below shows that we created the script.sh file with vi editor change the permission to make the file executable.Use this command to give the permission to the file to run as a script (sudo chmod +x script.sh), After that run the script by this command (sudo ./script.sh). Give password for your users by following the steps. And verify if the correct user only can access the privileged directory. So I verified only one user the other two are the same. We successfully ran this bash script and works so interesting.</p><p>Please follow for more projects that are associated with Linux/AWS Cloud/ and DevOps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2391925195b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Server Configuration and Troubleshooting]]></title>
            <link>https://towardsaws.com/web-server-configuration-and-troubleshooting-543fb1351c21?source=rss-ff877e73920e------2</link>
            <guid isPermaLink="false">https://medium.com/p/543fb1351c21</guid>
            <dc:creator><![CDATA[Kabir Faqiri ]]></dc:creator>
            <pubDate>Sun, 13 Aug 2023 00:01:04 GMT</pubDate>
            <atom:updated>2023-11-12T04:26:20.166Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JmyIRRd91Ip-vv9-KETg1w.jpeg" /></figure><p><strong><em>Intro:</em></strong></p><p>A smooth and responsive online presence is pivotal for any business in the modern digital age. As our company gears up for an anticipated surge in website traffic owing to the launch of our new product, the IT team is entrusted with a crucial task. This project revolves around setting up, verifying, and troubleshooting a new web server intended to balance the projected load. With reports of regional access issues and the need for a tailored promotional landing page, this endeavor presents both a challenge and an opportunity.</p><p><strong><em>Objectives:</em></strong></p><p>1. Web Server Setup: Install, configure, and optimize an Apache HTTP Web Server on a CentOS EC2 instance.</p><p>2. Global Verification: Ensure the website is accessible worldwide by both internal teams and a select user base.</p><p>3. Customization: Craft a unique landing page for our promotional campaign, offering visitors a special welcome message.</p><p>4. Troubleshooting &amp; Log Analysis: Delve into server logs to identify, analyze, and rectify any reported user access issues.</p><p><strong><em>So, lets get Started:</em></strong></p><p><strong>Step 1:</strong> We will start with launching an EC2 instance per steps of Page 1 and 2. Search for EC2 in your console click on it and click on “<strong>Launch Instance</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Qcs-O14zXIIY4_Ekov-qA.jpeg" /></figure><p><strong>Step 2:</strong> In the page 3 we name our instance I named it “<strong>Centos</strong>” and then click on “<strong>Search more AMIs</strong>”. Per page 4 search for centos on the search engine and Click on “<strong>AWS Marketplace AMIs</strong>” and select on “<strong>CentOs (x86_64) — with Updates HVM</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nOAqCaCZA_YzM7BSzI70Ug.jpeg" /></figure><p><strong>Step 3</strong>: As shown below now click on “<strong>Continue</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pqrcOtuW34BKHHgexrc6gg.jpeg" /></figure><p><strong>Step 4</strong>: Per page 4 we are going to make a key-pair for our CentOs machine, name it, select “<strong>RSA</strong>” and select “.<strong>pem</strong>” and finally click on “<strong>Create key pair</strong>” Per page 5 we will select the keypair we just created. Then we will create a security group allowing HTTP, SSH and HTTPS to access the web. Also, make sure you enable “<strong>Auto-assign public IP</strong>.” Finally, “<strong>Launch instance</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qiIx_Qd8oZfkKE1z0MSRLw.jpeg" /></figure><p>As shown below our CentOs EC2 instance is up and running successfully. One thing to note that I could install and enable httpd through user data. However, since I am learning Linux, I like to interact with CLI manually because its so fun and I enjoy it. Now, lets Click on “<strong>Connect</strong>” so we SSH to the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ddPhIF7yz1Zcv1IgFWRpw.png" /></figure><p><strong>Step 5</strong>: Search for “terminal” on your Mac and open it. As opened login as root user beacause we wil need permssions to SSH. Copy the Example part as shown in page 9 we need to run it after these commands.</p><pre>##this command makes you a root user <br>sudo su <br>##now input your computer password to be root<br>Enter Password <br>##we want change the directory to downloads becase our CentOs key-pair is in that folder<br>cd downloads</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eXXo_Khn0VF7-1QjNftjfQ.jpeg" /></figure><p><strong>Note:</strong> make sure your substitute ec2-user@ec2 to centos@ec2 so the command work for our CentOs machine. As shown below now we are connected to our machine. CONGRATS!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EtVFPSSEL9cHgR01QxNQNQ.jpeg" /></figure><p><strong>Step 6</strong>: Per page 10 and 11 type and enter the below commands. I will be explaining the commands and their functions below.</p><pre>##install updates on your machine. we use yum package manager since its a CentOs machine<br>##the reason we use -y in the end is because the machine will ask us to confirm by inputting y means yes<br>sudo yum install update -y <br>##now install httpd on your machine by running <br>sudo yum install httpd -y <br>##now lets enable httpd by running <br>sudo systemctl enable httpd <br>##now start httpd by running <br>sudo systemctl start httpd <br>##now check the status of httpd if its installed and running successfully by running <br>sudo systemctl status httpd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MsZ0YcJL1bVTLBO2cy-b-Q.jpeg" /></figure><p><strong>Step 7</strong>: Now we are going to change our directory to this path /var/www/html and create our index.html file inside the /html directory</p><pre>cd /var/www/html<br>##now we want to check if we have a index.html file. If not, we are going to create one<br>ls -la <br>##there is total 0 files in the directory so we need create one by running <br>touch index.html<br>##now lets list if the file is created <br>ls <br>##now we need to open index.html file with a text editor and past our HTML code<br>## I am using vi editor you use nano as well. <br>vi index.html<br>##below is the HTML code that you can copy and past in the index.html folder</pre><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br><br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;Welcome to LUIT&lt;/title&gt;<br>    &lt;style&gt;<br>        @import url(https://medium.com/&#39;https://fonts.googleapis.com/css2?family=Times+New+Roman&amp;display=swap&#39;);<br><br>        body {<br>            font-family: &#39;Times New Roman&#39;, serif;<br>            background-color: purple;<br>            display: flex;<br>            justify-content: center;<br>            align-items: center;<br>            height: 100vh;<br>            margin: 0;<br>            overflow: hidden;<br>        }<br><br>        .container {<br>            background-color: rgba(255, 255, 255, 0.8);<br>            padding: 60px 80px;<br>            border-radius: 15px;<br>            text-align: center;<br>            max-width: 600px;<br>            width: 100%;<br>            opacity: 0;<br>            transform: translateY(-20px);<br>            animation: fadeInMove 1.5s forwards;<br>        }<br><br>        .highlight {<br>            color: gold;<br>            font-size: 3em;<br>            text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);<br>            display: block;<br>            margin-top: 30px;<br>        }<br><br>        h1 {<br>            margin: 0;<br>            color: #333;<br>            font-size: 2.5em;<br>            font-weight: bold;<br>        }<br><br>        @keyframes fadeInMove {<br>            to {<br>                opacity: 1;<br>                transform: translateY(0);<br>            }<br>        }<br>    &lt;/style&gt;<br>&lt;/head&gt;<br><br>&lt;body&gt;<br><br>    &lt;div class=&quot;container&quot;&gt;<br>        &lt;h1&gt;Welcome to&lt;/h1&gt;<br>        &lt;span class=&quot;highlight&quot;&gt;LUIT - Gold Team&lt;/span&gt;<br>    &lt;/div&gt;<br><br>&lt;/body&gt;<br><br>&lt;/html&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dvR4PARRxsiid803cpWOLg.jpeg" /></figure><p><strong>Step 8</strong>: Once index.html is modified, we will copy our centos “<strong>Public IPv4 address</strong>” and past it in a new window browser and hit enter. Dah! Dah! we successfully created our custom HTML page with CentOs EC2 instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WxXKEYaPG557eS6NQCiE3Q.jpeg" /></figure><p><strong>Step 9</strong>: In this step, To address the website issues, I checked the latest 15 entries from our server’s Access and Error Logs in “<strong>/var/log/httpd/”</strong>. These logs were then saved as “<strong>AccessLogs[081223].txt”</strong> and “<strong>ErrorLogs[081223].txt”</strong> respectively for further analysis. I will explain the commands and their functions below.</p><pre>##Lets list the last access logs for our httpd server by running <br>sudo tail -n 15 /var/log/httpd/access_log<br>##you can see the repond below the commands they are our access logs <br>##Lets list the last error logs for our httpd server by running<br>sudo tail -n 15 /var/log/httpd/error_log<br>##now we want to redirect the access logs to a new directory by running <br>sudo tail -n 15 /var/log/httpd/access_log &gt; Accesslogs(081223).txt<br>##now lets list the files if we can see our Accesslogs(081223)/txt directory by running <br>ls <br>##there we go based on page 14 our directory is there so now lets open it and see if our access logs are there<br>cat Accesslogs(081223).txt<br>##we are going to repeat the same process for our ErrorLogs file per page 15<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yLScBDcHr4QMEJ5ygZ5cAA.jpeg" /></figure><p><strong><em>Result:</em></strong></p><p>Achieving seamless web performance, especially during high-traffic promotional events, is critical for maintaining our brand’s reputation and ensuring a positive user experience. This project addresses immediate company needs and equips the team with the skills and insights necessary for future troubleshooting and server management tasks. Armed with detailed steps, real-time scenarios, and a clear objective, the team is all set to embark on this web server expedition. Success in this project translates to a successful product launch and a further step in consolidating our company’s digital footprint.</p><p>Thanks for following this project. For more Cloud/DevOps projects, please follow and stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=543fb1351c21" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/web-server-configuration-and-troubleshooting-543fb1351c21">Web Server Configuration and Troubleshooting</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure Remote Admin & Troubleshoot of EC2 Instances]]></title>
            <link>https://aws.plainenglish.io/secure-remote-admin-troubleshoot-of-ec2-instances-2e69de719aad?source=rss-ff877e73920e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e69de719aad</guid>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[keypair]]></category>
            <dc:creator><![CDATA[Kabir Faqiri ]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 20:55:15 GMT</pubDate>
            <atom:updated>2023-11-13T01:40:00.513Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P6Yu-6PGTp0u3I-mWCor5Q.png" /></figure><blockquote>Intro</blockquote><p>This guide presents three levels of tasks for managing AWS EC2 instances. Starting with basic tasks, we deploy a Linux EC2 instance and establish SSH access. Next, we step up to deploying a Windows EC2 instance with RDP access. Lastly, we explore advanced security by replacing SSH with AWS Simple Systems Manager (SSM) on the Linux instance, providing enhanced security. This progression offers a robust understanding of EC2 configuration, security, and management.</p><blockquote>Problem</blockquote><p>Skyward Technologies, a global tech firm, uses AWS EC2 for hosting over 100 Linux and Windows applications. Their dispersed IT team struggles with server management due to a lack of secure and efficient remote administration tools, leading to security risks, decreased productivity, and increased costs.</p><blockquote>Solution</blockquote><p>By implementing Secure Shell (SSH) for Linux and Remote Desktop Protocol (RDP) for Windows instances, Skyward can enhance security, boost productivity, and reduce operational costs. This setup also simplifies server administration and scales effectively as the company expands, making it a robust, future-ready solution.</p><blockquote>So, lets get Started!</blockquote><p><strong>Step 1</strong>. Search for EC2 on AWS console click on “<strong>EC2</strong>” then click on “<strong>Launch instance</strong>” shown on page 2. Page 3 name your instance and select you AMI. Since this lab is based on Linux, I use Amazon Linux. Page 4 select instance type t2.micro is sufficient for this lab. Then click on “<strong>Create new key pair</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9QfXej52c7O60Cehs8siMg.jpeg" /></figure><p><strong>Step 2</strong>. Now as shown at page 5 name your key pair select<strong> “RSA”</strong> and select “.<strong>pem”</strong> file format. Click on “<strong>Create key pair</strong>.” After the creation of the key pair, its going to be downloaded in your “<strong>downloads folder.</strong>” We will need this “<strong>.pem</strong>” file while SSHing to our instance. Make sure you enable “<strong>Auto-assign public IP.” </strong>As shown page 6. Click on “<strong>Create security group” </strong>then<strong> “Allow SSH traffic from anywhere” </strong>Finally, Click on<strong> “Launch instance”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YM4ryfqHkN047iHSFuy4mw.jpeg" /></figure><p><strong>Step 3</strong>. As shown page 7 our instance is running successfully. Click on “<strong>Connect</strong>” as shown on page 7. Click on “<strong>SSH client</strong>” as shown on page 8. Now open your search for your terminal and open it. I am a Mac user, so I use terminal. If you are using Windows, you can use MobaXterm, Cmd and more. As shown page 10, you need to have right permission to SSH. You need to execute these commands.</p><pre># This command makes you root user if you have the Admin password.<br># Su means switch user. Input your password and login.<br>sudo su<br># After this change your directory to downloads because our .pem keypair file in that directory<br>cd downloads </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f-xiGm_1aYeECOARjqmyrA.jpeg" /></figure><p><strong>Step 4</strong>. Please refer to page 8 and Copy Example section this is the actual command that asks for our keypair and our EC2 instance id is there so we can SSH. Now past the command, press enter. Confirm the process by typing yes. We are connected! Congrats. Let do something extrat, I changed my host-name to SkywardTechnologies as shown page 12.</p><pre># This is the command I copied from page 8 <br>ssh -i &quot;linuxkey.pem&quot; ec2-user@ec2-44-200-138-244.compute-1.amazonaws.com<br># This command changes your hostname <br>hostname &quot;put your hostname here&quot;<br># Then run bash <br>bash<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JAKi_dLX0FFTKpMom1Kf1A.jpeg" /></figure><p>Now we are going to configure our EC2 instance to use “<strong>SSM”</strong> instead of “<strong>SSH”</strong>. In order to do this, we are going to create an “<strong>IAM</strong>” role. Search for “<strong>IAM</strong>” Click on it and then on the left side look for the “<strong>Roles</strong>” and click on it. As shown on page 13, click on <strong>AWS service</strong>, then click on EC2 and hit “<strong>Next”. </strong>Now search for <strong>AmazonSSMManagedInstanceCore</strong> and select that policy and click on “<strong>Next</strong>”. Name your role and click on “<strong>Create role</strong>”. Page 16 verifies that our role is successfully created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XvKhfFts6GM0OpaVW5PjMg.jpeg" /></figure><p>Per Page 17 we cant connect with AWS session Manager, so we go to our EC2 instances click on “<strong>Action</strong>” then click on “<strong>Security</strong>” and then click on “<strong>Modify IAM role</strong>”. As show on page 19 we need to select the IAM role that we created and click on “<strong>Update IAM role</strong>”. After this if we go to AWS session Manager we can connect through AWS session manager so click on “<strong>Connec</strong>t”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eR4WLj5C6LNdttLtB_Dkgg.jpeg" /></figure><p>As shown on page 21, that we can connect to our EC2 instance through AWS Session Manager and that a success. Now since we can connect to our EC2 instance through SSM we dont need SSH and we will delete it from our inbound rules as shown on page 22. FYI. Removing SSH from inbound rules of our security group will not impact our connection through SSM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E7thKcIjkzI3O6dtlbP-FQ.jpeg" /></figure><p>Now the part of our lab is to create a windows EC2 instance and connect to it. We will be setting up a security group for RDP access, and connecting to your EC2 using RDP. An ideal primer for all cloud computing enthusiasts. I will walk your through this process. For this assignment as Mac user I will need Microsoft Remote Desktop.</p><p><strong>Step 1</strong>. We are going to launch a Windows EC2 instance. Make sure you stay in free-tier scope because that all we need in computing power for this lab. Click on “<strong>Launch instance</strong>”, name your instance select “<strong>Microsoft Windows Server 2022 Base</strong>” AMI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4MuD4OdPZmpDqWlTyCcRog.jpeg" /></figure><p>Also, click “<strong>Create security group</strong>”, click on “<strong>Allow RDP traffic</strong>” and finally click on “<strong>Launch instance</strong>”. As shown on page 4, our instance is successfully running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ye5ftFdhL0q-FSPlnYhXSA.jpeg" /></figure><p><strong>Step 2.</strong> Download Microsoft Remote Desktop and open it. This will help us<strong> RDP </strong>to our Windows instance. Click on “<strong>Add PC</strong>” and go back to your EC2 instance and copy the “<strong>Public IPv4 DNS</strong>” as shown on the page 7.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WPUDw8r6BB0po-3vk3pT8w.jpeg" /></figure><p>We are going to past the “<strong>Public IPv4 DNS</strong>” to the PC name slot, then we click “<strong>Add</strong>”, then as shown on page 10 we select the EC2 instance and click on “<strong>Connect</strong>” then click on “<strong>RDP Client</strong>”, and then click on “<strong>Get password</strong>” as shown on page 11.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMTJZdhywziT0N2gWhVEEA.jpeg" /></figure><p>As shown on page 12 you need to upload the keypair that you created for this instance with then click on “<strong>Decrypt password</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*huRe-OC_ELG5e1pkD3_HDw.jpeg" /></figure><p>Once you decryption done you the password will appear and your copy and past both username and password to Microsoft Remote Desktop. Finally, we are inside our Windows EC2 instance successfully as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3tGIuQaUy1--unRpl60Thw.jpeg" /></figure><p>Now Skyward Technologies have Linux and Windows EC2 instances that are configured and connected securely. Thank You So Much for reading and following this lab. Please stay tuned and follow me for more for Cloud labs and project with real-time scenario.</p><h3><a href="https://plainenglish.io/">PlainEnglish.io</a> 🚀</h3><p><em>Thank you for being a part of the In Plain English community! Before you go:</em></p><ul><li><em>Be sure to </em><strong><em>clap</em></strong><em> and </em><strong><em>follow</em></strong><em> the writer</em></li><li><em>Learn how you can also </em><a href="https://plainenglish.io/blog/how-to-write-for-in-plain-english"><strong><em>write for In Plain English</em></strong></a><em>️</em></li><li><em>Follow us: </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>X</em></strong></a><strong><em> | </em></strong><a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><strong><em> | </em></strong><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><strong><em> | </em></strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong><em>Discord</em></strong></a><strong><em> | </em></strong><a href="https://newsletter.plainenglish.io/"><strong><em>Newsletter</em></strong></a></li><li><em>Visit our other platforms: </em><a href="https://stackademic.com/"><strong><em>Stackademic</em></strong></a><strong><em> | </em></strong><a href="https://cofeed.app/"><strong><em>CoFeed</em></strong></a><strong><em> | </em></strong><a href="https://venturemagazine.net/"><strong><em>Venture</em></strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e69de719aad" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/secure-remote-admin-troubleshoot-of-ec2-instances-2e69de719aad">Secure Remote Admin &amp; Troubleshoot of EC2 Instances</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS-S3-Static-Website-With-CloudFront.]]></title>
            <link>https://towardsaws.com/medium-family-4b069c67ef2f?source=rss-ff877e73920e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b069c67ef2f</guid>
            <dc:creator><![CDATA[Kabir Faqiri ]]></dc:creator>
            <pubDate>Fri, 21 Jul 2023 23:48:03 GMT</pubDate>
            <atom:updated>2023-11-12T04:26:21.960Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Amazon S3 Static Website Hosting with CloudFront" src="https://cdn-images-1.medium.com/max/1011/1*j8MoU2Jjo19MxhIzEMMk8A.jpeg" /></figure><p>AWS-S3-Static-Website-With-CloudFront. Medium family! As my first Cloud/DevOps project, I am hosting a static website with AWS <strong>S3</strong> storage and content delivery service with <strong>CloudFront</strong>. So let&#39;s get started!</p><h3>Scenario</h3><p>Level Up Bank, a pretend digital bank, gets new customers mainly through its website. Right now, the website is managed by a dedicated team on a local server, which is expensive and complex. To simplify things, cut costs, improve scalability availability, and reduce management tasks. The bank has decided to use AWS <strong>S3</strong> for its website. Also, by adding AWS <strong>CloudFront</strong> to <strong>S3</strong> hosted static website, Level Up Bank can take advantage of website performance and enhanced website security which is IMPORTANT!</p><p><strong>Note</strong>: How CloudFront can secure our S3-hosted static website. Because CloudFront incorporates (WAF) which protects websites from SQL injections, (XSS), and (CSRF.)</p><p><strong><em>Create an S3 Bucket as Shown Below</em></strong></p><figure><img alt="Create the S3 bucket" src="https://cdn-images-1.medium.com/max/1024/1*asTE3WUkh2_g-km6Eju4yw.jpeg" /></figure><p><strong><em>Name Your Bucket it needs to be globally unique</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4x50GZ6LbVtAFF7zq3FX2Q.jpeg" /></figure><p><strong><em>Uncheck Block all public access so you can access the static website</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gnm_eI-DLeeH0oMtossnDw.jpeg" /></figure><p><strong><em>Scroll down and keep all the other configuration default and create the BUCKET</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zutp1ymXmUGpylugyZp8-Q.jpeg" /></figure><p><strong><em>Navigate inside of the bucket and upload the index.html file</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WCKOm0A2mxGCGEeRzQF7zg.jpeg" /></figure><p><strong><em>Enable the static website hosting</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*i_KAhkmom1McTEaSTwYD-Q.jpeg" /></figure><p><strong><em>Navigate to bucket permissions to edit the policy.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YcjkfqLGUSE2PQOj6qF4pA.jpeg" /></figure><p><strong><em>Add this policy. This policy give the permission so you can access the static website</em></strong></p><pre>{<br> “Version”:”2012–10–17&quot;,<br> “Statement”:[{<br> “Sid”:”PublicReadGetObject”,<br> “Effect”:”Allow”,<br> “Principal”: “*”,<br> “Action”:[“s3:GetObject”],<br> “Resource”:[“arn:aws:s3:::your_bucket_name/*”<br> ]<br> }<br> ]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZU4DnSZm6__HDnh9lX4eg.jpeg" /></figure><p><strong><em>Navigate to properties of your bucket, scroll down and click the link</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-hGVHpO-ar7J1X7SJSgYw.png" /></figure><p>WOW!! WE DID IT!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-I1awbAmqnpZkW706374Q.jpeg" /></figure><h4><strong>Now we need to add this S3 static website to CloudFront for the mentioned reason on introduction paragraph.</strong></h4><p><strong><em>Search CloudFront on your console</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1GByXltTOu0ajjdgx1MdEw.jpeg" /></figure><p><strong><em>Choose your S3 bucket from the origin domain</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gd28Dl4oQHk5etq2Hp9FlQ.jpeg" /></figure><p><strong><em>Choose redirect HTTP to HTTPS to make it secure</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*akwnJDAcPeB3VTLdG7WT9w.jpeg" /></figure><p><strong><em>Scroll down and create the distribution and click on the distribution. Make sure you enable CloudFront Firewall (WAF) to get our website more secure.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZWOqFJcjSZF-VeqSXRKPQQ.jpeg" /></figure><p><strong><em>Copy the domain name and past it on your browser. Dah! Dah! HERE WE GO! We are using CloudFront along our S3 static website.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VtSHld2977FOiTBYcTLVxg.jpeg" /></figure><p>To improve the security of the website further, we need to make certain that end users cannot bypass CloudFront and directly access the content stored in the S3 Bucket. In order to do that, simply we need to go to our S3 bucket and Block public access of our bucket.</p><p><strong><em>I did that and now I cant access my static website through the bucket URL. I can only use CloudFront to access the static website which thats what we want.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8i61GuEJLsg_fhFh2AeQfg.jpeg" /></figure><p>Thank You So Much for Reading my Article! Please Follow my Blog for my upcoming DevOps/Cloud Projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b069c67ef2f" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/medium-family-4b069c67ef2f">AWS-S3-Static-Website-With-CloudFront.</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>