Log into AWS Console
Navigate to EC2 → Instances → Launch Instance
Configure:
Name: ApacheServer
AMI: Amazon Linux 2 or Ubuntu
Instance Type: t2.micro (Free Tier eligible)
Key Pair: Create or select an existing key pair
go to network setting
Security Group:
Allow SSH (port 22) from your IP.
Allow HTTP (port 80) from anywhere (0.0.0.0/0)
Connect to the Instance
Using SSH:
chmod 400 your-key.pem
ssh -i "your-key.pem" ec2-user@
Install Apache Web Serve
For Amazon Linux 2:
sudo yum update -y
sudo yum install -y httpd
For Ubuntu:
sudo apt update
sudo apt install -y apache2
Start and Enable Apache
sudo systemctl start httpd
sudo systemctl enable httpd
Test Your Website
In your browser, go to:
http://your-ec2-public-ip
Top comments (0)