DEV Community

Tarekh Inamdar
Tarekh Inamdar

Posted on

1 1 1 1 1

Ec2-based Web Server-configure Apache on an Ec2 instance.

by T Inamdar

👋Hey there! I’m Tarekh Inamdar, a Computer Engineering diploma student, currently diving deep into the world of Cloud Computing with a special focus on Amazon Web Services (AWS). I’m passionate about modern tech, automation, and how cloud platforms are transforming the IT industry.

Currently learning AWS tools and cloud concepts hands-on, I’m building a strong foundation in services like EC2, S3, IAM, and more. I enjoy working on real-world cloud setups and aim to master tools that power today’s scalable and secure infrastructures.

📌About Project

This project demonstrates how to launch a virtual machine (EC2 instance) on AWS Cloud and set up a basic web server using Apache HTTP Server. It helps students and beginners understand real-world concepts like cloud infrastructure, remote access, web hosting, and port management.

🔧Steps

1. Launch an EC2 Instance
• Choose Amazon Linux 2 AMI

Image description
• Instance type: t2.micro (free tier)

Image description
• Create or use an existing key pair

Image description
• Configure security group to allow:
• SSH (port 22)
• HTTP (port 80)

Image description

2. Connect to the EC2 Instance
Open a terminal and run:
ssh -i your-key.pem ec2-user@your-instance-public-ip

Image description
Step 3: Install Apache
sudo yum install httpd -y

Image description
• Update the package repository
sudo yum update -y

Image description
• Start and Enable Apache
sudo systemctl start httpd
sudo systemctl enable httpt
• Verify installation
sudo systemctl status httpt

Image description
4. Deploy a Web Page
echo "Welcome to My Web Server" | sudo tee /var/www/html/index.html>/dev/null

Image description
5. Access the Web Server
open a browser and go to:
http://your-instance-public-ip

  1. you should see "Welcome to My Web Server".

Image description
7. configure Auto Start(Optional)
• Ensure the web server starts on reboot
sudo systemct enable httpt

Image description
Conclusion

have successfully deployed an EC2-based web server running Apache.This setup is commonly used for hosting websites, web applications, or
acting as a reverse proxy.

Google AI Education track image

Work through these 3 parts to earn the exclusive Google AI Studio Builder badge!

This track will guide you through Google AI Studio's new "Build apps with Gemini" feature, where you can turn a simple text prompt into a fully functional, deployed web application in minutes.

Read more →

Top comments (0)

Runner H image

Automate Your Workflow in Slack, Gmail, Notion & more

Runner H connects to your favorite tools and handles repetitive tasks for you. Save hours daily. Try it free while it’s in beta.

Try for Free

👋 Kindness is contagious

Explore this insightful piece, celebrated by the caring DEV Community. Programmers from all walks of life are invited to contribute and expand our shared wisdom.

A simple "thank you" can make someone’s day—leave your kudos in the comments below!

On DEV, spreading knowledge paves the way and fortifies our camaraderie. Found this helpful? A brief note of appreciation to the author truly matters.

Let’s Go!