<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Usama Bhatti</title>
    <description>The latest articles on DEV Community by Usama Bhatti (@usamabhatti7).</description>
    <link>https://dev.to/usamabhatti7</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1511538%2F99d7000f-e2ee-4e8a-8ba4-b458f3e4ed37.jpeg</url>
      <title>DEV Community: Usama Bhatti</title>
      <link>https://dev.to/usamabhatti7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/usamabhatti7"/>
    <language>en</language>
    <item>
      <title>How to Launch a Simple Website on AWS EC2: A Step-by-Step Guide</title>
      <dc:creator>Usama Bhatti</dc:creator>
      <pubDate>Wed, 24 Jul 2024 16:48:40 +0000</pubDate>
      <link>https://dev.to/usamabhatti7/how-to-launch-a-simple-website-on-aws-ec2-a-step-by-step-guide-407i</link>
      <guid>https://dev.to/usamabhatti7/how-to-launch-a-simple-website-on-aws-ec2-a-step-by-step-guide-407i</guid>
      <description>&lt;p&gt;I recently took the plunge into cloud computing and decided to host a simple website on an AWS EC2 instance. I wanted to share the step-by-step process I followed, along with some insights and learnings. Whether you're new to AWS or looking to solidify your cloud skills, this guide will help you get started with EC2.&lt;/p&gt;

&lt;p&gt;Also, I’m excited to announce that this is the first of many posts to come! I’ll be regularly sharing my tech journey and projects, so stay tuned!&lt;/p&gt;

&lt;p&gt;Step 1: Launching an EC2 Instance&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;Log in to AWS Management Console: Head over to AWS Management Console.&lt;/li&gt;
&lt;li&gt;Navigate to EC2: Find EC2 under the Compute category in the Services menu.&lt;/li&gt;
&lt;li&gt;Launch Instance: Click the "Launch Instance" button.&lt;/li&gt;
&lt;li&gt;Choose an Amazon Machine Image (AMI): Select the Amazon Linux 2 AMI (free tier eligible).&lt;/li&gt;
&lt;li&gt;Choose an Instance Type: Go with t2.micro (free tier eligible).&lt;/li&gt;
&lt;li&gt;Configure Instance: Proceed with the default settings.&lt;/li&gt;
&lt;li&gt;Add Storage: Use default storage settings.&lt;/li&gt;
&lt;li&gt;Add Tags: Optionally, add tags for easier identification.&lt;/li&gt;
&lt;li&gt;Configure Security Group:

&lt;ul&gt;
&lt;li&gt;Create a new security group.&lt;/li&gt;
&lt;li&gt;Add a rule to allow HTTP traffic: Type: HTTP, Protocol: TCP, Port Range: 80, Source: Anywhere (0.0.0.0/0).&lt;/li&gt;
&lt;li&gt;Add a rule to allow SSH traffic: Type: SSH, Protocol: TCP, Port Range: 22, Source: My IP.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Review and Launch: Review the settings and click "Launch".&lt;/li&gt;
&lt;li&gt;Key Pair: Create a new key pair, download it, and store it securely.&lt;/li&gt;
&lt;li&gt;Launch: Click "Launch Instances".&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;Step 2: Connecting to Your EC2 Instance&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Terminal/Command Prompt on your local machine.&lt;/li&gt;
&lt;li&gt;Change Permissions: Ensure your key pair file has the correct permissions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;command: &lt;strong&gt;chmod 400 /path/to/your-key-pair.pem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;-Connect to Instance:&lt;/p&gt;

&lt;p&gt;command: &lt;strong&gt;ssh -i /path/to/your-key-pair.pem ec2-user@your-ec2-public-ip&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Or you can either use Putty Tool to securely SSH into your instance with using the key pair that you download while creating the Ec2 Instance.&lt;/p&gt;

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

&lt;p&gt;Step 3: Setting Up a Web Server&lt;/p&gt;

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

&lt;p&gt;Update Packages:&lt;br&gt;
&lt;strong&gt;sudo yum update -y&lt;/strong&gt;&lt;br&gt;
Install Apache Web Server:&lt;br&gt;
&lt;strong&gt;sudo yum install -y httpd&lt;/strong&gt;&lt;br&gt;
Start Apache:&lt;br&gt;
&lt;strong&gt;sudo systemctl start httpd&lt;br&gt;
sudo systemctl enable httpd&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Verify Apache: Open your browser and navigate to your EC2 instance's public IP address to see the Apache test page.&lt;/p&gt;

&lt;p&gt;Step 4: Hosting Your Website&lt;/p&gt;

&lt;p&gt;Create a Simple HTML File:&lt;br&gt;
echo "&lt;/p&gt;
&lt;h1&gt;This is a Static Website hosted on EC2 Instance!!!&lt;/h1&gt;" &amp;gt; /var/www/html/index.html

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

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This project was a fantastic introduction to AWS EC2. Here are some key takeaways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Instance Management: Learned how to launch and manage an EC2 instance.&lt;/li&gt;
&lt;li&gt;Security Groups: Gained insights into configuring security groups for HTTP and SSH access.&lt;/li&gt;
&lt;li&gt;Web Server Setup: Successfully installed and configured an Apache web server on a Linux instance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm excited to continue sharing my tech journey and projects with you all. Stay tuned for more posts coming soon!&lt;/p&gt;

&lt;p&gt;Feel free to reach out if you have any questions or need further clarification. Happy cloud computing! 🌥️&lt;/p&gt;

</description>
      <category>aws</category>
      <category>amazon</category>
      <category>devops</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
