DEV Community

Tarekh Inamdar
Tarekh Inamdar

Posted on

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.

Top comments (0)