<?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 Christopher Lilly on Medium]]></title>
        <description><![CDATA[Stories by Christopher Lilly on Medium]]></description>
        <link>https://medium.com/@chlilly?source=rss-9a50d0ef6d65------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RmESUx5-Ns22vOgJghY72A.jpeg</url>
            <title>Stories by Christopher Lilly on Medium</title>
            <link>https://medium.com/@chlilly?source=rss-9a50d0ef6d65------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 08:52:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chlilly/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[Auto-Scaling Group of EC2 Instances for high availability.]]></title>
            <link>https://chlilly.medium.com/auto-scaling-group-of-ec2-instances-for-high-availability-3ab4bc44246a?source=rss-9a50d0ef6d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ab4bc44246a</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[aws-auto-scaling]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <dc:creator><![CDATA[Christopher Lilly]]></dc:creator>
            <pubDate>Tue, 01 Nov 2022 13:50:53 GMT</pubDate>
            <atom:updated>2022-11-01T13:50:53.657Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jYxqW2RQq1GzG8kivEXx1A.png" /></figure><h3>AWS Autoscaling</h3><p>For this project we are autoscaling a group of EC2 instances for high availability. <strong>AWS Auto Scaling </strong>monitors your applications and automatically adjusts capacity to maintain steady, predictable performance at the lowest possible cost.<strong> AWS Auto Scaling </strong>refers to a collection of Auto Scaling capabilities across several AWS services.</p><h3>Task:</h3><ol><li><strong>Create a VPC</strong> with CIDR10.10.0.0/16.</li><li><strong>Create three public subnets</strong> with 10.10.1.0/24 &amp; 10.10.2.0/24 &amp; 10.10.3.0/24.</li><li><strong>Create an autoscaling group</strong> using t2.micro instances. All instances should have <strong>Apache installed</strong> on each instance with the ability to <strong>check any random IP address and be able to produce a test page</strong>. Ensure the autoscaling group is using the public subnets from #2.</li><li>The autoscaling <strong>min and max should be 2 and 5.</strong></li><li><strong>Create an Application Load Balancer</strong> to distribute traffic to the autoscaling group.</li><li><strong>Create web server security group</strong> that allows inbound traffic from HTTP from your Application Load Balancer.</li><li><strong>Create a load balancer security group</strong> that allows inbound traffic from HTTP from 0.0.0.0/0.</li></ol><h3>Create a VPC</h3><p>We kick things off by <strong>creating a VPC with CIDR 10.10.1.0/24. </strong>Select VPC and more from VPC settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*CT7E_wf2pXUd5yzvRb6ChQ.png" /></figure><p><strong>Next </strong>increase the number of availability zones to accommodate the 3 subnets you’ll be creating. Enter into<strong> Customize subnets CIDR block and use the subnets 10.10.1.0/24 &amp; 10.10.2.0/24 &amp; 10.10.3.0/24.VP</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*QQ4yY7ZR2ig5g7_GCn-pnQ.png" /></figure><p>VPC is created in the management console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkgXNInwiNzZVr134SQ0AA.png" /></figure><h3>Launch Template</h3><p>To create the Autoscaling group I first created a <strong>launch template.</strong> Launch templates are like <strong>launch configurations</strong> in that they specify the instance configuration information. Information includes the ID of the Amazon Machine Image (AMI), the instance type, a key pair, security groups, and the other parameters that you use to launch EC2 instances. Launch templates include additional features such as supporting multiple versions of a template. With versioning, you can create a subset of the full set of parameters and then reuse it to create other templates or template versions. <a href="https://digitalcloud.training/amazon-ec2-auto-scaling/#launch-templates-vs-launch-configurations">Amazon EC2 Auto Scaling | AWS Cheat Sheet (digitalcloud.training)</a></p><p>You can type in <strong>Launch template </strong>in the console search bar to bring up the template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*T6aa_hIKDHUifr1DbF1jDg.png" /></figure><p>Select the <strong>AMI and instance type</strong> you want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*vbNBoM9zZnw6Ax1TnqTYcg.png" /></figure><p>After you select your <strong>key pair</strong> go down to network settings and change <strong>Auto assign public IP to enable. </strong>Also <strong>create security group</strong> with your network inbound rules and use the <strong>VPC you created.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*zLXkRu3d7GMQQQtxEGmcNg.png" /></figure><p>Now in <strong>advanced details </strong>you want to copy the code to launch Apache in user data. Then click <strong>create launch template.</strong></p><pre>#!/bin/bash<br>yum update -y<br>yum install -y httpd<br>systemctl start httpd<br>systemctl enable httpd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*eawHzEjagFQ3VkrQ5reRGA.png" /></figure><h3>Autoscaling Group</h3><p>Go back to AWS main console scroll all the way down until you see <strong>Auto Scaling Group</strong> in the left side pane window. Then create an auto scaling group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*UETHObyXgOq9Z8_NTkuqlw.png" /></figure><p>Give your <strong>ASG </strong>a name and select your <strong>launch template</strong> you created. Then select your <strong>VPC with the three public subnets</strong> you create and click next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*RFmdcD4tSdX6scdIVCcRDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*qME_jcTqDYDznePRDyXJag.png" /></figure><h3>Application Load Balancer</h3><p>Create an <strong>Application Load Balancer</strong> to distribute traffic to the autoscaling group. Give your load balancer a name. You will see your <strong>VPC</strong> and then select the subnets you created. The<strong> autoscaling min and max </strong>should be 2 and 5. Load balancer type was changed to <strong>“Internet-facing”.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*bUFQUznRzP7kYsScLQLbUg.png" /></figure><p>Enable group metrics for <strong>CloudWatch</strong> to monitor our instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*WNe_52Jha0BClH2tKbxlKA.png" /></figure><p>The autoscaling <strong>min and max should be 2 and 5.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*2b1vPazOS4ou_i8vufVMCw.png" /></figure><p>Create a <strong>load balancer security group </strong>that allows inbound traffic from HTTP from 0.0.0.0/0. Give it a name, use the VPC for the project, and add the inbound rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*-yiH63HccCYBuIgfCWZ4dg.png" /></figure><p>You’ll see your <strong>EC2 Instances</strong> running. Select one and connect instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dgDFVwx-4Wl_-jQ0_IjP-w.png" /></figure><p>Open a new <strong>web browser </strong>and enter the <strong>public IP address</strong> of one of your instances to see the <strong>Apache test page.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YhdDJKNHTWwl_0GXG17ssw.png" /></figure><p>Success! So, in conclusion we:</p><ol><li>Created a VPC using CIDR and subnets.</li><li>Created the launch template for our auto scaling group.</li><li>Inserted the script to install Apache.</li><li>Created the Autoscaling group using the launch template.</li><li>Created a load balancer and security group for the load balancer.</li></ol><h3>Bonus: CloudFormation!</h3><p>I also tried my hand at doing this project using <strong>CloudFormation, </strong>VS code and <strong>GitHub. </strong>Did it work? Yes and no apparently Json/Yaml are very sensitive.<strong> </strong>One wrong space or punctuation can mess up the whole code. For whatever reason it did not like what the “A” in AWS was giving below. However, it did create my diagram for me😁. Thanks for reading!!!</p><pre><strong>A</strong>WSTemplateFormatVersion: 2010-09-09<br>Resources:<br>  VPC:<br>    Type: &#39;AWS::EC2::VPC&#39;<br>    Properties:<br>      CidrBlock: 10.10.0.0/16<br>      EnableDnsSupport: true<br>      EnableDnsHostnames: true<br>      Tags:<br>        - Key: Name<br>          Value: !Join <br>            - &#39;&#39;<br>            - - !Ref &#39;AWS::StackName&#39;<br>              - &#39;-VPC&#39;<br>  InternetGateway:<br>    Type: &#39;AWS::EC2::InternetGateway&#39;<br>    DependsOn: VPC<br>  InternetGatewayAttachment:<br>    Type: &#39;AWS::EC2::VPCGatewayAttachment&#39;<br>    Properties:<br>      VpcId: !Ref VPC<br>      InternetGatewayId: !Ref InternetGateway<br>  PublicSubnet1:<br>    Type: &#39;AWS::EC2::Subnet&#39;<br>    Properties:<br>      VpcId: !Ref VPC<br>      AvailabilityZone: !Select <br>        - 0<br>        - !GetAZs &#39;&#39;<br>      CidrBlock: 10.10.1.0/24<br>      MapPublicIpOnLaunch: true<br>  PublicSubnet2:<br>    Type: &#39;AWS::EC2::Subnet&#39;<br>    Properties:<br>      VpcId: !Ref VPC<br>      AvailabilityZone: !Select <br>        - 0<br>        - !GetAZs &#39;&#39;<br>      CidrBlock: 10.10.2.0/24<br>      MapPublicIpOnLaunch: true<br>  PublicSubnet3:<br>    Type: &#39;AWS::EC2::Subnet&#39;<br>    Properties:<br>      VpcId: !Ref VPC<br>      AvailabilityZone: !Select <br>        - 0<br>        - !GetAZs &#39;&#39;<br>      CidrBlock: 10.10.3.0/24<br>      MapPublicIpOnLaunch: true<br>  PublicRouteTable:<br>    Type: &#39;AWS::EC2::RouteTable&#39;<br>    Properties:<br>      VpcId: !Ref VPC<br>  PublicRoute:<br>    Type: &#39;AWS::EC2::Route&#39;<br>    Properties:<br>      RouteTableId: !Ref PublicRouteTable<br>      DestinationCidrBlock: 0.0.0.0/0<br>      GatewayId: !Ref InternetGateway<br>  PublicSubnet1RouteTableAssociation:<br>    Type: &#39;AWS::EC2::SubnetRouteTableAssociation&#39;<br>    Properties:<br>      RouteTableId: !Ref PublicRouteTable<br>      SubnetId: !Ref PublicSubnet1<br>  PublicSubnet2RouteTableAssociation:<br>    Type: &#39;AWS::EC2::SubnetRouteTableAssociation&#39;<br>    Properties:<br>      RouteTableId: !Ref PublicRouteTable<br>      SubnetId: !Ref PublicSubnet2<br>  PublicSubnet3RouteTableAssociation:<br>    Type: &#39;AWS::EC2::SubnetRouteTableAssociation&#39;<br>    Properties:<br>      RouteTableId: !Ref PublicRouteTable<br>      SubnetId: !Ref PublicSubnet3<br>  InstanceSecurityGroup:<br>    Type: &#39;AWS::EC2::SecurityGroup&#39;<br>    Properties:<br>      GroupName: Week7SG<br>      GroupDescription: Enable SSH access and HTTP from the load balancer only<br>      VpcId: !Ref VPC<br>      SecurityGroupIngress:<br>        - IpProtocol: tcp<br>          FromPort: 22<br>          ToPort: 22<br>          CidrIp: 0.0.0.0/0<br>        - IpProtocol: tcp<br>          FromPort: 80<br>          ToPort: 80<br>          CidrIp: 0.0.0.0/0<br>  LaunchTemplate:<br>    Type: &#39;AWS::EC2::LaunchTemplate&#39;<br>    Properties:<br>      LaunchTemplateName: !Sub &#39;${AWS::StackName}-ASGTemplate&#39;<br>      LaunchTemplateData:<br>        NetworkInterfaces:<br>          - DeviceIndex: 0<br>            AssociatePublicIpAddress: true<br>            DeleteOnTermination: true<br>            Groups:<br>              - !Ref InstanceSecurityGroup<br>        ImageId: ami-09d3b3274b6c5d4aa<br>        InstanceType: t2.micro<br>        UserData:<br>          &#39;Fn::Base64&#39;: !Sub |<br>            #!/bin/bash<br>            yum update -y<br>            yum install httpd -y<br>            systemctl start httpd<br>            systemctl enable httpd<br>            amazon-linux-extras install epel -y<br>            yum install stress -y<br>  AutoScalingGroup:<br>    Type: &#39;AWS::AutoScaling::AutoScalingGroup&#39;<br>    Properties:<br>      LaunchTemplate:<br>        LaunchTemplateId: !Ref LaunchTemplate<br>        Version: !GetAtt LaunchTemplate.LatestVersionNumber<br>      MaxSize: &#39;5&#39;<br>      MinSize: &#39;2&#39;<br>      DesiredCapacity: &#39;2&#39;<br>      VPCZoneIdentifier:<br>        - !Ref PublicSubnet1<br>        - !Ref PublicSubnet2<br>        - !Ref PublicSubnet3<br>      MetricsCollection:<br>        - Granularity: 1Minute<br>  ScalingPolicyWeek7Project:<br>    Type: &#39;AWS::AutoScaling::ScalingPolicy&#39;<br>    Properties:<br>      AdjustmentType: ChangeInCapacity<br>      AutoScalingGroupName: !Ref AutoScalingGroup<br>      ScalingAdjustment: &#39;1&#39;<br>  CloudWatchAlarm:<br>    Type: &#39;AWS::CloudWatch::Alarm&#39;<br>    Properties:<br>      EvaluationPeriods: &#39;1&#39;<br>      Statistic: Average<br>      Threshold: &#39;50&#39;<br>      AlarmDescription: Trigger an Alarm if the CPU usage is higher than 50%<br>      Period: &#39;60&#39;<br>      AlarmActions:<br>        - !Ref ScalingPolicyWeek7Project<br>      Namespace: AWS/EC2<br>      Dimensions:<br>        - Name: AutoScalingGroupName<br>          Value:<br>            Ref: AutoScalingGroup<br>      ComparisonOperator: GreaterThanThreshold<br>      MetricName: CPUUtilization<br>      ApplicationLoadBalancer : <br>        Type : &#39;AWS::ElasticLoadBalancingV2::LoadBalancer&#39;<br>    Properties : <br>      Subnets : Ref Subnets<br>  ALBTargetGroup : <br>    Type : &#39;AWS::ElasticLoadBalancingV2::TargetGroup&#39;<br>    Properties : <br>      HealthCheckIntervalSeconds : &#39;30&#39;<br>      HealthCheckTimeoutSeconds : &#39;5&#39;<br>      HealthyThresholdCount&quot; : &#39;3&#39;<br>      Port : &#39;80&#39;<br>      Protocol : HTTP<br>      UnhealthyThresholdCount : &#39;5&#39;<br>      VpcId : Ref VpcId</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ab4bc44246a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Ngnix in a EC2 instance using User data.]]></title>
            <link>https://chlilly.medium.com/installing-ngnix-in-a-ec2-instance-using-user-data-d1004d834784?source=rss-9a50d0ef6d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1004d834784</guid>
            <category><![CDATA[user-data]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[bash-script]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Christopher Lilly]]></dc:creator>
            <pubDate>Tue, 25 Oct 2022 12:15:26 GMT</pubDate>
            <atom:updated>2022-10-25T12:20:12.772Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*ofMinHxcluo9O7VmblTBSw.jpeg" /></figure><p>In this project, I am going to show how to create an EC2 instance with a Nginx Web Server. We are going to install the Nginx Web Server using a Bash Script in User Data.</p><h3>To do list:</h3><p>1. Create a t2.micro EC2 instance with the OS of your choice (Just make sure it is free tier).</p><p>2. In the user-data field, use a script that updates all packages, installs NGINX, and start the service.</p><p>3. Verify that the instance has the NGINX webserver downloaded and installed through the public IP.</p><h3>Create an EC2 Instance</h3><p>In your AWS management console go to EC2 and <strong>launch instance.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*ZxfCv7d9RMk0rjkMez8T1w.png" /></figure><p>In next window give your instance a name if you like. Select your <strong>key pair</strong> or create one if you don’t have one. Then move on to instance type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*xoF4vIBHqqgSKg4Df6QwXQ.png" /></figure><p>As you scroll down you will see <strong>“Additional”</strong>. Click that drop down and input your script into <strong>User data</strong>.</p><pre>#!/bin/bash/<br>#This is a script to install Nginx <br>sudo yum update -y<br>sudo amazon-linux-extras install nginx1 -y<br>sudo systemctl enable nginx<br>sudo systemctl start nginx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*4oUmDfYgGWlq1rqbSIiHOQ.png" /></figure><p>Complete your EC2 launch by clicking<strong> launch instance</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*VzS46KlryW-k-T397jqxfA.png" /></figure><p>After creating your EC2 instance wait a few minutes to let it provision before connecting. Once done connect to your EC2 instance. You should see the <strong>EC2 prompt </strong>come up. Now grab the public IP address and enter it into a new web browser. The Nginx welcome page should be displayed, and you’re done!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ktpTLVdh5BqeJy5Bxvomhg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1004d834784" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create an AWS EC2 instance in AWS to host Apache.]]></title>
            <link>https://chlilly.medium.com/create-an-aws-ec2-instance-in-aws-to-host-apache-f7d2a9390f68?source=rss-9a50d0ef6d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7d2a9390f68</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[apache]]></category>
            <dc:creator><![CDATA[Christopher Lilly]]></dc:creator>
            <pubDate>Tue, 18 Oct 2022 12:20:21 GMT</pubDate>
            <atom:updated>2022-10-18T12:20:21.383Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/671/0*kHQPhjJsh7BUcqMU.png" /></figure><p>Peace readers! In this article I learned how to create an EC2 instance in AWS to host to an Apache web server with a custom webpage. To do this you will need an AWS account (free tier). Here is what we are looking to accomplish so let’s get started!</p><p><strong>1. Launch an EC2 Amazon Linux t2.micro (free tier) in a public subnet.</strong></p><p><strong>2. Create a security group that allows inbound traffic on HTTP for 0.0.0.0/0 and allows inbound traffic on SSH from your IP address.</strong></p><p><strong>3. SSH into your EC2 instance and install Apache with a custom webpage using a BASH script.</strong></p><h3>Launch an EC2 Amazon Linux t2.micro in a public subnet.</h3><p>We start in the AWS Management Console by searching EC2 in the search bar. It’s good practice to favorite your most used services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*8jwyNI9YDy5DnVeMB78aJw.png" /></figure><p>Next, we select the Amazon Machine Image (AMI) we want to use. For this project it is the Amazon Linux 2 AMI (free tier) as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*W3xGYUAyqMN--aNG-Z12jA.png" /></figure><h3>Create Key Pair</h3><p>Key pairs allow you to connect to your instance securely. A key pair, consisting of a private key and a public key, is a set of security credentials that you can use to prove your identity while connecting to an instance. As you scroll down from creating your instance you will see the section to create a key pair.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*6MfwYkjUOKGpTq_K8cDgdw.png" /></figure><p>After clicking on create new key pair this window will come up for you to create the key pair. Then select create key pair.</p><ul><li>Key pair name: Name of your choosing</li><li>Key pair type: RSA (encrypted private and public key pair)</li><li>Private key file format: .pem (for use with SSH)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*tIrTtkP08xUoV8ZrE7E6Xw.png" /></figure><h3>Network Settings</h3><p>For the network settings we want to create a security group that allows inbound traffic on HTTP for 0.0.0.0/0 and allows inbound traffic on SSH from your IP address. So, under network settings we do the following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*lpGs5NLE3bgb_ZalLK7jow.png" /></figure><p>As you can see AWS sets things up for us through automation. You have a network name, a subnet that can be set by default, and a public IP address that is auto assigned. To complete the network settings select Allow SSH traffic from and Allow HTTP traffic from the internet.</p><h3>BASH Script</h3><p>Under user data in the instance wizard, you are able to write your bash script here. Later on in the terminal this or Vim did not work for me. So, I had to use Nano to get this portion done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*Vfh1HwYow64PWKbrYdUsSA.png" /></figure><p>Create EC2 instance complete!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*4WXuxEJ4wTB8HTwp6yFt9w.png" /></figure><h3>SSH into your Instance</h3><p>Now that your instance is created you should see it on the AWS Management Console. Click on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*x-OPh5IY0gkJBAt1oCJdeA.png" /></figure><p>Then check the box of your instance and click connect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d7XJBk4px6wL11R4MFcWFQ.png" /></figure><p>Here is where I ran into a roadblock because the instance wasn’t connecting. So, I had to go back into Security settings and change the security group settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*7dPUPxLTlPWet4C4-ZdVLA.png" /></figure><p>After saving the settings and reconnecting we now have the EC2 prompt displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*WrPAPaWPFzPRriCmIphk3A.png" /></figure><p>As mentioned earlier in the article Vim was giving me problems. Erasing my script after each new line. So, I used Nano to get this portion of the project completed and it did not fail.</p><p>#!/bin/bash</p><p>sudo yum update -y</p><p>sudo yum install -y httpd</p><p>sudo systemctl start httpd</p><p>sudo echo “&lt;h1&gt; Peace welcome to the Blue Team! &lt;/H1&gt;” &gt; /var/www/html/index.html</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*_F9LQlOafmV0yacrGj-o9w.png" /></figure><h3>Download Apache</h3><p>Using the following commands:</p><p>sudo yum update -y</p><p>sudo yum install -y httpd</p><p>sudo systemctl start httpd</p><p>sudo systemctl enable httpd</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*wtm3PFRxqDc2NHi2zvlddA.png" /></figure><h3>Open a web browser</h3><p>Open a web browser and use the public IP address to your webpage to see the custom page you created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*7GuFs6dsR8i2hmX1gorOww.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7d2a9390f68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning Git: Forking, Cloning, Pushing, Pulling a Repository Oh My!]]></title>
            <link>https://chlilly.medium.com/learning-git-forking-cloning-pushing-pulling-a-repository-oh-my-e2730042f0c9?source=rss-9a50d0ef6d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2730042f0c9</guid>
            <category><![CDATA[gi̇t]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Christopher Lilly]]></dc:creator>
            <pubDate>Tue, 11 Oct 2022 14:50:43 GMT</pubDate>
            <atom:updated>2022-10-11T14:50:43.556Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*_bDXyoBxWU8kCpTc.jpg" /></figure><p>Peace readers! In this article we will learn and understand using text editor and using source control with Git and GitHub. Some of the screenshots will not match but the understanding is there. There were challenges to be had during this project but with challenges come understanding and solutions. Let’s get started!</p><h3>Git</h3><blockquote>Git is a free and open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. (<em>Source</em>: <a href="https://git-scm.com/">Git (git-scm.com)</a></blockquote><h3>GitHub</h3><blockquote>GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere. This tutorial teaches you GitHub essentials like repositories, branches, commits, and pull requests. (<em>Source</em>: <a href="https://docs.github.com/en/get-started/quickstart/hello-world">Hello World — GitHub Docs</a>)</blockquote><h3>The Task</h3><p>You will need a GitHub account if you don’t already have one. Just go to <a href="http://github.com/">GitHub.com</a> and create your free account. This project was done working in a CentOS 7 cloud environment.</p><ol><li>Fork the repository</li><li>Clone the forked repository to your cloud server environment</li><li>Using Vim, create a change to the file that is in the repository directory</li><li>Save the file and add to your local repo, then commit the file</li><li>Push the file back to your own GitHub repository</li><li>Send a pull request to merge with the production repository</li></ol><h3>Installing Git</h3><p>Before you get started you want to make sure you have Git installed. Even if Git is already installed you want the latest version of Git. To do that open VS Code, PowerShell, or whatever you&#39;re comfortable with and <strong><em>ssh </em></strong>into your server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*X4Ms6WikSMvjShAQbld-jg.png" /></figure><p>To install type in the command: <strong><em>sudo yum install git</em></strong></p><p><strong>Personal Access Token</strong></p><p>You will need a personal access token to use later on in the project. Here is the link with instructions on how to do that <a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token">Creating a personal access token — GitHub Docs</a>.</p><h3>Forking</h3><p>If you want to contribute to an existing project to which you don’t have push access, you can<strong> fork</strong> the project. When you <strong>fork </strong>a project, GitHub will make a copy of the project that is yours.</p><p>After you create your GitHub account. Go to the repository you are wanting to fork and click fork as shown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z__EfWokHNymkd8tZo3OIw.png" /></figure><p>Next select create fork.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*FLtJ-8jewnPv5RuBpV4i2g.png" /></figure><p>When you go to your profile you will see the repository there. The repository is now forked and ready to be cloned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YFnZE_gq9FQlQNAWkHLFPg.png" /></figure><h3>Cloning</h3><p>Cloning is simply copying an existing repository that you can contribute to. To do that you will use the <strong><em>git clone &lt;url&gt;</em></strong> command.</p><p>I created the directory for this project to keep things organized. Enter the command <strong><em>mkdir /directoryname</em></strong>. Then change directory by <strong><em>cd /directoryname</em></strong> you choose. Now you should be in the <strong><em>/directoryname/directoryname/</em></strong> you created. Next create the directory for your project <strong><em>mkdir /project4</em></strong>. Here is where you will work from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*_z9PBb7tGg6ZrOGjMyx6bQ.png" /></figure><p>Once that&#39;s done you will run these commands to set up your global username, password and vim editor.</p><ol><li><strong>git config — -global user.name “Your GitHub User Name”</strong></li><li><strong>git config — -global user.email “Your GitHub Email”</strong></li><li><strong>git config — -system core.editor vim</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*6SV9WHrFG_pU8_DTPcSVmQ.png" /></figure><p>Type in the command <strong>git clone &lt;url&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*3-PrbxaEY72scwKONQeXFg.png" /></figure><p>The ls /LevelUpinTech command shows us what’s in that directory. As you can see, we have 4 items in the directory. Switch over to the directory to access the linux.sh file you’ll be editing in vim by using the command cd directoryname/. From there type vim linux.sh to open the script file and edit. In vim to edit type i to insert text and esc to exit once done. Then you want to write and save by typing :wq.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*DueZ_CktEuRxRpUsmnbQKw.png" /></figure><p>Use the command cat to see the changes to the linux.sh file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*AZA4jYFjUthuZ3V4_JMGmA.png" /></figure><p>Now we want to see what the status is of the file. To do that you enter command git status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*DXpZq5UJB3I7NUDYdHUjIw.png" /></figure><p>Our changes are staged but not added yet. Now we type in the command git add . DO NOT forget this period!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*DPyj0JBnlHRyPplXGq5OBQ.png" /><figcaption>“Get” was typed a lot.</figcaption></figure><p>We want to give a little description of what the changes are for others to know what we did with it. To do that type in the command git commit -m “description”. Now you can see in git status there’s nothing staged and nothing to commit. Also notice that the branch you are in is the main branch. However, it is good practice to create your own branch to work in so that you don’t accidentally mess up the work that’s being done in the main branch. You are ready to PUSH!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*aEbKnrx5brMXbZVH_tAIfQ.png" /></figure><h3>Push</h3><p>To push the repository back to GitHub, type the command git push -u /directoryname/directoryname/ master.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*vbW8X7vkTY0ckEkLKs71Sw.png" /></figure><p>You will add a comment just like you did with the linux.sh file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*wdBVtb3AcCCWCrh3nq7DWA.png" /></figure><p>Now back in GitHub you will see the changes you made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*JcFIJjvOYrv4Pa5823uNpQ.png" /><figcaption>GitProject4 added with the description</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*9XbtKxPRAR0D4r-UJexHaA.png" /><figcaption>Open linux.sh file to see changes made.</figcaption></figure><h3>Pull</h3><p><a href="https://git-scm.com/book/en/v2/GitHub-Maintaining-a-Project">Pull Requests can either come from a branch in a fork of your repository or they can come from another branch in the same repository. The only difference is that the ones in a fork are often from people where you can’t push to their branch and they can’t push to yours, whereas with internal Pull Requests generally both parties can access the branch.</a></p><p>To pull go where it says contribute. From the drop-down menu in the repository select open pull request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*_wlll0Ym8qXPar7xJdcyiA.png" /></figure><p>Add some text for other contributors to see and comment on what was done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*CFjVUK21fcOjPUoAK_E9LA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*O0wXsXj9xhYSkvxdN6CbGQ.png" /><figcaption>Pull request complete with added commits and comments.</figcaption></figure><h3>Complete!</h3><p>Now pat yourself on the back!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2730042f0c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Git on CentOS 7.]]></title>
            <link>https://chlilly.medium.com/installing-git-on-centos-7-f7801a278c27?source=rss-9a50d0ef6d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7801a278c27</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[centos7]]></category>
            <dc:creator><![CDATA[Christopher Lilly]]></dc:creator>
            <pubDate>Tue, 04 Oct 2022 20:15:31 GMT</pubDate>
            <atom:updated>2022-10-04T20:15:31.890Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*ainXrN8ozEWvC8fImHVg0A.png" /></figure><p><strong>Git</strong> is a free and open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. This is a quick article demonstrating how to install Git on a CentOS 7 distribution.</p><p>For this demonstration I used a cloud playground with the Centos 7 distribution IP and password provided.</p><p>First, you want to ssh to the Centos 7 server. After connecting it will ask you to change your password. See image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*MTPlwas2RulU9HE3BJ0RyQ.png" /></figure><p>Once you’ve changed your password you then want to change your directory to the root directory. This is because you need root user privileges in order to use <strong><em>sudo </em></strong>and install Git on your server<strong><em>. </em></strong>After you’re in the <strong>root</strong> directory type<strong><em> </em>command: sudo yum install git</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*dxkdr3axmsOnTzkgHFP0Cw.png" /></figure><p>The install will run, and you’ll be returned back to the root directory. To see if in fact Git is on your system run the <strong>command: git — — version</strong> and you’ll see which version you have installed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*oaXqZKMMT1QkplayQRqTfQ.png" /></figure><p>You’re all done you now have Git installed on your Centos 7 server! Please comment and share if this article has helped. Hit that follow button for more upcoming articles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7801a278c27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn how to install a NGINX web server on CentOS8]]></title>
            <link>https://chlilly.medium.com/learn-how-to-install-a-nginx-web-server-on-centos8-6e6e985f8e73?source=rss-9a50d0ef6d65------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e6e985f8e73</guid>
            <dc:creator><![CDATA[Christopher Lilly]]></dc:creator>
            <pubDate>Thu, 22 Sep 2022 02:03:43 GMT</pubDate>
            <atom:updated>2022-09-22T11:49:49.846Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*EOhADcs_kOchbhbuWakMqQ.png" /></figure><p>For this project I will take you through the steps on how to install a Nginx webserver on CentOS 8 in Linux. Before we get into the steps of installing the webserver let&#39;s look at our objectives and find out what we need to do.</p><h4><strong>Objectives:</strong></h4><ul><li>Update all packages on the server</li><li>Install a Nginx Web Server</li><li>Enable the Nginx Web Server</li><li>Grab the IP address and confirm you can view the test webpage</li></ul><h3>Set Up</h3><p>First, you’ll need to set up by opening your command prompt and establishing a SSH session.</p><p><strong><em>Run Command: </em></strong>ssh user@cloud-server-ip</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*ASASmES0iOHx2qBWt6ik2Q.png" /></figure><p>After you’ve entered your password and are connected check to see what current directory, you’re in.</p><p><strong><em>Run Command: </em></strong>pwd</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/285/1*RAB4OdgG8TK_VLddjJJfcQ.png" /></figure><p>You are in the <strong><em>/home/user_name</em></strong> directory.</p><h3>Step 1 — Configure Nginx repository</h3><p>In order to install the web server, we will need to add the repository.</p><p><strong><em>Run Command:</em></strong> $ vi /etc/yum.repos.d/nginx.repo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*hVEPpEPoliw-vuYXmA3Mfw.png" /></figure><p>It will ask for the password that you entered earlier in the set up.</p><h3>Step 2 — Install Nginx on CentOS 8</h3><p>To install the latest stable Nginx server, run the following yum command.</p><p><strong><em>Run Command: </em></strong>$ sudo yum install nginx</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ReEiyejIV-rAStblZbKhHA.png" /></figure><h3>Step 3 — Enable/Start Nginx server</h3><p>First enable Nginx service by running <strong><em>systemctl </em></strong>command so that it starts at server boot time.</p><p><strong><em>Run Command:</em></strong> $ sudo systemctl enable nginx</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*wdoA31oHxdEvLJ3wtffR_Q.png" /></figure><p>Start Nginx</p><p><strong><em>Run Command: </em></strong>$ sudo systemctl start nginx</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*md674L9jQ2nit_UjauOtKw.png" /></figure><p>Check Status</p><p><strong><em>Run Command: </em></strong>$ sudo systemctl status nginx</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*Xoc1Bur7wdpmaQ2Y4D41Ug.png" /></figure><h3>Step 4 — Get the public IP address to verify web access</h3><p>To do this you must open and enable port 80 and 443 using the <strong><em>firewall-cmd</em></strong> command.</p><p><strong><em>Run Command:</em></strong></p><p>$ sudo firewall-cmd — permanent — zone=public — add-service=http<br>$ sudo firewall-cmd — permanent — zone=public — add-service=https<br>$ sudo firewall-cmd — reload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*0-Ky7fQDMeL0HhjtpMiEIw.png" /></figure><p>Verify that port 80 or 443 opened using<strong><em> ss</em></strong> command</p><p><strong><em>Run Command: </em></strong>$ sudo ss -tulpn</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*HSTqbFtioDvNF5UDDxdStA.png" /></figure><p>If you do not know your server IP address run the following <strong><em>IP</em></strong> command</p><p><strong><em>Run Command:</em></strong> $ ip a</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*RFNgIQ03ntLVegfuk__OJg.png" /><figcaption>IP displayed in red box</figcaption></figure><h3>Step 5— Verify access to the test webpage over the internet</h3><p>Open a web browser and type in your IP address. It should return the Nginx test webpage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*srpewHpnST9F1kZGRGPvUg.png" /></figure><h4>Congratulations! You have installed a Nginx Web Server on CentOS 8.</h4><p>If this step-by-step guide was helpful to you, be sure to drop a comment below and follow me for more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e6e985f8e73" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>