
Create a simple EC2 instance and run a webserver and access it from outside
Introduction In this blog, we will create a simple EC2 instance using Linux, set up a basic web server, and access it from outside using a public IP. This is a fundamental hands-on exercise to understand how cloud servers work. Prerequisites AWS account Basic Linux command knowledge SSH client (Terminal or Git Bash) Step 1: Launch an EC2 Instance Log in to AWS Management Console Go to EC2 Dashboard Click Launch Instance Configuration: Name: simple-linux-server AMI: Amazon Linux Instance Type: t2.micro Key Pair: Create and download Network settings: Allow SSH (port 22) Allow HTTP (port 80) Click Launch Instance Step 2: Connect to the Instance (Linux Terminal) Navigate to the folder where your key is downloaded and run: chmod 400 your-key.pem ssh -i your-key.pem ec2-user@your-public-ip Step 3: Install Apache Web Server Update packages and install Apache: sudo yum update -y sudo yum install httpd -y Step 4: Start and Enable Apache sudo systemctl start httpd sudo systemctl enable httpd Che
Continue reading on Dev.to Tutorial
Opens in a new tab




