<?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 ~noah_dave~ on Medium]]></title>
        <description><![CDATA[Stories by ~noah_dave~ on Medium]]></description>
        <link>https://medium.com/@noahdavemunene?source=rss-0ab0653232e5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qO5IqxPNjJIJ9bZfSEoMTQ.jpeg</url>
            <title>Stories by ~noah_dave~ on Medium</title>
            <link>https://medium.com/@noahdavemunene?source=rss-0ab0653232e5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:51:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@noahdavemunene/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[Setting up an EC2 Instance + web Server (Apache)]]></title>
            <link>https://medium.com/@noahdavemunene/setting-up-an-ec2-instance-web-server-apache-on-209442b272da?source=rss-0ab0653232e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/209442b272da</guid>
            <dc:creator><![CDATA[~noah_dave~]]></dc:creator>
            <pubDate>Fri, 03 May 2024 04:50:40 GMT</pubDate>
            <atom:updated>2024-05-03T05:26:36.691Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Apache Server + EC2" src="https://cdn-images-1.medium.com/max/750/1*ZG6IGwBwBCnHssV70dT9rw.jpeg" /></figure><p>Hey, <br>This week, I am super excited 😄 we’re getting into the core AWS services and practical projects.</p><p>Today, we will be kicking things off by diving into real-world tasks. We’ll start by creating an EC2 instance and launching an Apache Web Server.</p><h4>#<strong> Prerequisites</strong></h4><p>1.Computer with internet access.</p><p>2.AWS Account (Free Tier recommended).</p><p>3.An active default Virtual Private Cloud (VPC)</p><p>4.A public Subnet.</p><p>5. Also, it&#39;s imperative you have familiarity with Bash Script basic knowledge and use of Linux CLI.</p><h4><strong># Objectives</strong></h4><p>1.Create and launch an Ec2 instance via the Aws Management Console.</p><p>2.Configure the Security Groups to allow SSH and HTTP connection to the instance.</p><p>3.SSH into Ec2 instance and by using a script, install Apache Web Server with custom webpage.</p><p><em>Let&#39;s get started:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*HKBcguVxXz1MGY2Y.gif" /></figure><p><em>Easy steps, follow along…</em></p><h4>Step 1: Preparing to create and launch an EC2 instance.</h4><blockquote>1. We will start simply by signing in to the AWS Management Console. Go to the Aws Management console and sign in with IAM account (root user not recommended).</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2lnDBC4-Q57-AXEDu_rdmA.png" /><figcaption>Sign in as an IAM user.</figcaption></figure><blockquote>2. Let’s now navigate to EC2 Dashboard, click on “Services”, type and select “EC2” under the Compute section then click <strong>launch an Instance.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6rrc4KQS7Zevt06sNmYNrA.png" /><figcaption>EC2 Selection</figcaption></figure><blockquote>3.After a new web page loads, <em>input</em> your preferred name for the EC2 instance.</blockquote><figure><img alt="Instance Name" src="https://cdn-images-1.medium.com/max/1024/1*N7-YX7zpBKLxH_irRdedMg.png" /><figcaption>Instance Name</figcaption></figure><blockquote>4.Next, choose an <strong>Amazon Linux Machine Image (AMI) </strong>for your instance. Let&#39;s just keep the defaults.</blockquote><figure><img alt="AMI" src="https://cdn-images-1.medium.com/max/1024/1*ZQM9-cD-S8BgF2nEqeuHbw.png" /><figcaption>AMI Selection.</figcaption></figure><blockquote>5.Then, for the “Instance Type”, opt for the t3. micro instance type or stick with the <strong>default settings</strong> if preferred.</blockquote><figure><img alt="Instance type: t2.micro" src="https://cdn-images-1.medium.com/max/1024/1*MC0UtNpje4N4etg2mxBzJw.png" /><figcaption>Instance type.</figcaption></figure><blockquote>6.Now, it’s time to choose a key pair, or you can click “Create new key pair” if you don’t already have one. If you’re unsure how to create a Key Pair look into the following <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html"><em>documentation</em></a><em> for assistance. I</em>n this case, we will have to create a key pair to enable us to connect to the CLI later.</blockquote><figure><img alt="Key Pair Creation" src="https://cdn-images-1.medium.com/max/1024/1*VQBiI_DVy-k3rN5fZY594w.png" /><figcaption>Key Pair</figcaption></figure><blockquote>7. Now onto the Networking section, configure networking settings by selecting create a security Group that allows ssh(port22) and HTTP (port80) connections. Make sure to select “allow SSH” and “allow HTTP”.</blockquote><figure><img alt="Selecting SSH and HTTP in Networking part" src="https://cdn-images-1.medium.com/max/1024/1*S4IS9XsbM2C0NYPMFk8SRw.png" /><figcaption>Networking section</figcaption></figure><p>8.We will keep all other settings as defaults and proceed to “Review and Launch.” Review your instance configuration to ensure everything is correct, then click “<strong>Launch Instance</strong>” to create your EC2 instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qC5l1ghUgGYryQSA0vaguw.png" /></figure><blockquote>Congratulations! Your instance has been successfully created! You should now see a success message similar to the one below.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ei-0DlFuxdfySHGeSWD2aQ.png" /></figure><h4>Step 2: Installing and configuring and Apache Web Server with Custom Web Page.</h4><p>At this step, we will accomplish objective number 3, which entails installing and configuring an Apache Web Server, followed by testing it with a sample custom webpage.</p><blockquote>1. &quot;SSH into your EC2 Instance: There are several methods to connect to the AWS CLI:</blockquote><blockquote>First method, use an SSH client of your choice such as PuTTY, OpenSSH, MobaXterm, or Termius, then SSH into the instance by using the public IP and the PEM or PPK key you downloaded.</blockquote><blockquote>Secondly, open the local CLI and enter the following command (applicable only on Linux or Mac OS). Remember to replace @your-instance-ip with your Public IP and your-key with KeyPair you downloaded earlier.</blockquote><pre>ssh -i your-key.pem ec2-user@your-instance-ip.</pre><blockquote>Alternatively, you can use the AWS Management Console to login to the AWS CLI.</blockquote><p>In this case, I will be using Putty to connect to the EC2 CLI. <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html"><strong>Guidance on how to connect to putty here.</strong></a></p><p>Once you establish a connection using any of the methods above, you should see the message below confirming that you are in the EC2 Instance OS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*dhM7v_OYLk_Tw3mrYvT5uw.png" /><figcaption>putty EC2 CLI</figcaption></figure><blockquote>2. Now that we’re logged into the EC2 Instance via CLI, let’s switch to the “superuser” to elevate our privileges and avoid having to use Sudo for every command.</blockquote><blockquote>Enter <em>sudo su </em>and execute the command. You’ll notice that the <strong>$ </strong>sign will change to<strong> #,</strong> indicating that we now have root access and privileges.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*yB5Y261BulSnLoHx1FNg9g.png" /><figcaption>sudo cmd</figcaption></figure><blockquote>3.Here we will now create a bash script known as WebServer.sh and input the command to configure the Apache web Server.</blockquote><blockquote>Now run touch WebServer.sh, Confirm its created by ls and then run nano Webserver.sh just like below to get to the nano editor.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*z03fs2SCQmovj1grlPIItw.png" /><figcaption>bash Scripting</figcaption></figure><blockquote>Once in the nano editor , enter below script that will install Apache. Save ctrl+o and exit out of editor ctrl+x</blockquote><pre>#!/bin/bash<br><br>yum update -y<br><br>yum install -y httpd<br><br>systemctl enable httpd<br><br>systemctl start httpd</pre><blockquote>4. At this point we have to give permission to the user so that we can execute the script. Run the chmod +x WebServer.sh.</blockquote><blockquote>Now run the command <em>./WebServer.sh on the CLI </em><strong><em>or </em></strong><em>alternatively copy the </em>Public IP and paste into a new tab Web browser…</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eWEmLxJwMR4DIP47weRgwQ.png" /></figure><p>Voila! The Apache installation was successful.</p><blockquote>5. Lastly, lets now add some sample custom data to webpage. Run cd /var/www/html/ in the CLI, create a file by running touch index.html.</blockquote><blockquote>Open editor by running nano index.html, Input the code below, save and exit the editor. Feel very free to edit your own message.</blockquote><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<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;My Portfolio&lt;/title&gt;<br>    &lt;style&gt;<br>        body {<br>            font-family: Arial, sans-serif;<br>            margin: 0;<br>            padding: 0;<br>            background-color: #f4f4f4;<br>        }<br>        header {<br>            background-color: #693b5e;<br>            color: #fff;<br>            padding: 18px;<br>            text-align: center;<br>        }<br>        nav {<br>            background-color: #698b65;<br>            color: #fff;<br>            padding: 10px;<br>            text-align: center;<br>        }<br>        nav a {<br>            text-decoration: none;<br>            color: #fff;<br>            margin: 0 10px;<br>        }<br>        section {<br>            padding: 10px;<br>            margin: 10px auto;<br>            max-width: 1000px;<br>        }<br>        h2 {<br>            color: #333;<br>        }<br>        p {<br>            color: #666;<br>            line-height: 1.6;<br>        }<br>        .contact-form {<br>            margin-top: 8px;<br>        }<br>        .contact-form input[type=&quot;text&quot;],<br>        .contact-form input[type=&quot;email&quot;],<br>        .contact-form textarea {<br>            width: 100%;<br>            padding: 10px;<br>            margin-bottom: 10px;<br>            border: 1px solid #ccc;<br>            border-radius: 5px;<br>            box-sizing: border-box;<br>        }<br>        .contact-form input[type=&quot;submit&quot;] {<br>            background-color: #2b550f;<br>            color: #fff;<br>            border: none;<br>            padding: 10px 20px;<br>            cursor: pointer;<br>            border-radius: 5px;<br>        }<br>        footer {<br>            background-color: #333;<br>            color: #fff;<br>            text-align: center;<br>            padding: 10px;<br>            position: fixed;<br>            bottom: 0;<br>            width: 100%;<br>        }<br>    &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;header&gt;<br>        &lt;h1&gt;Your Portfolio&lt;/h1&gt;<br>    &lt;/header&gt;<br>    &lt;nav&gt;<br>        &lt;a href=&quot;#about&quot;&gt;About Me&lt;/a&gt;<br>        &lt;a href=&quot;#contact&quot;&gt;Contact&lt;/a&gt;<br>    &lt;/nav&gt;<br>    &lt;section id=&quot;about&quot;&gt;<br>        &lt;h2&gt;About Me&lt;/h2&gt;<br>        &lt;p&gt;I&#39;m a new Cloud Engineer who recently joined Cloud Tech. I&#39;m passionate about leveraging cloud technologies to build<br>            scalable and resilient solutions.  I&#39;m excited to continue learning and<br>            contributing to innovative projects in the cloud space.<br>        &lt;/p&gt;<br>    &lt;/section&gt;<br>    &lt;section id=&quot;contact&quot;&gt;<br>        &lt;h2&gt;Contact&lt;/h2&gt;<br>        &lt;div class=&quot;contact-form&quot;&gt;<br>            &lt;form action=&quot;#&quot; method=&quot;post&quot;&gt;<br>                &lt;input type=&quot;text&quot; name=&quot;name&quot; placeholder=&quot;Your Name...&quot; required&gt;&lt;br&gt;<br>                &lt;input type=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Your Email..&quot; required&gt;&lt;br&gt;<br>                &lt;textarea name=&quot;message&quot; placeholder=&quot;Your Concern...&quot; rows=&quot;4&quot; required&gt;&lt;/textarea&gt;&lt;br&gt;<br>                &lt;input type=&quot;submit&quot; value=&quot;Send Message&quot;&gt;<br>            &lt;/form&gt;<br>        &lt;/div&gt;<br>    &lt;/section&gt;<br>    <br>&lt;/body&gt;<br>&lt;/html&gt;</pre><blockquote>Run systemctl restart httpd on the <strong>CLI</strong> and refresh the browser.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nka2qThMctpLz_Isk0Z2-Q.png" /></figure><blockquote>We did it!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*YIliMJpd1eEbq5BRt9YWvQ.gif" /></figure><p>Congratulations, Cloud superstar! 🎉 You’ve just rocked it by setting up your very own EC2 instance, installing and firing up that Apache web server, and adding your unique flair with a custom message! 😄</p><p>If you found this guide helpful, drop a comment or give it a round of applause. I’m eager to hear your thoughts!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=209442b272da" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>