โ๏ธ Cloud Provider: Amazon Web Services (AWS)
๐ฅ๏ธ Web Server: Apache
๐ Goal: Host a basic HTML web page on a cloud-based virtual server
๐ง Step 1: Launching an EC2 Instance
I started by launching an EC2 instance using Amazon Linux (you can also use Ubuntu or other Operating System). Here's what I did:
I created AWS Account by Visiting(https://aws.amazon.com/console/)
Logged into the AWS Management Console.
Navigated to EC2 and clicked Launch Instance.
Selected Amazon Linux 2023 Kernel-6.1 AMI.
Chose a t3.micro instance.
Created a key pair to securely connect to my instance via SSH.
Allowed HTTP (port 80) and SSH (port 22) in the Security Group settings.
Clicked Launch and waited for the instance to initialize.
๐ Step 2: Connecting to My EC2 Instance
Once the instance was running, I connected using SSH using Gitbash:
bash
Copy
Edit
ssh -i my-key.pem ec2-user@
Note: I had to make sure the .pem file had the correct permissions by following this steps:
bash
Copy
Edit
chmod 400 my-key.pem
๐ Step 3: Installing Apache Web Server
After connecting, I installed Apache using the following commands:
bash
Copy
Edit
sudo yum update -y # For Amazon Linux
sudo yum install httpd -y
Then I started the Apache server:
bash
Copy
Edit
sudo systemctl start httpd
sudo systemctl enable httpd
To verify Apache was working, I visited:
cpp
Copy
Edit
http://
And saw the Apache test page. โ
๐ Step 4: Deploying My First Web Page
I created a simple HTML page:
bash
Copy
Edit
echo "
Hello from EC2!
" | sudo tee /var/www/html/index.htmlThen reloaded the page in the browser, and โ my message was live on the internet!
โ
Final Result
Wow, i successfully deployed a simple web page from an EC2 instance using Apache. It might seem basic, but itโs a huge step in understanding cloud infrastructure and how websites work behind the scenes.
๐ก What I Learned
How to launch and configure a virtual server (EC2).
How to connect to it securely using SSH.
How to install and use a basic web server (Apache).
How to serve web content on the internet using public IPs.
The Challenges I faced.
One of the main challenges I encountered was getting the correct command syntax while setting up the Apache web server. I kept making small mistakes โ like missing sudo, using the wrong file paths, or incorrect echo/tee syntax. Every time I tried and failed, I learned a bit more about how Linux commands work.
It was frustrating at times, but I didnโt give up. Instead, I double-checked documentation, retried with corrections, and gradually figured out what worked. That process โ of failing, adjusting, and trying again โ is called persistence, and itโs a crucial part of learning anything new in tech.
When I finally saw โHello from EC2!โ in my browser, it wasnโt just a web page โ it was a result of patience, problem-solving, and persistence.
๐ Next Steps
Try using Nginx instead of Apache.
Set up a domain name and connect it using Route 53.
Use HTTPS with a free SSL certificate from Letโs Encrypt.
Deploy a full web app (e.g., Node.js, Flask, or static site from S3).
Top comments (0)