Home » Setup Apache Web Server on AWS EC2 – Step by Step

Setup Apache Web Server on AWS EC2 – Step by Step

Install APache webserver on AWS EC2

With an Apache web server and an EC2 instance, hosting a website on AWS is simple. This tutorial will show you how to install Apache, run an EC2 instance, and host a simple webpage step-by-step.

Step 1: Launch an EC2 instance

  • Go to AWS management console and click on EC2 Instances
  • First you have to select region where you want to deploy your application like us-east-1
  • Click Launch Instance
  • Name and Tag : XXXXXXXXX
  • AMI: Amazon Linux 2
  • Instance Type: t2.micro [ Free Tier eligible ]
  • Create Keypair
  • Network Setting: Leave as Default
  • Make sure enable public IP
  • Firewall security groups: Check SSH port 22 , HTTP port 80 and HTTPS port 443
  • Storage: 20 gp2
  • Click Launch Instances

Step 2: Connect to your EC2 Instance

  • Copy the Public IP of your EC2 Instance
  • Open your Terminal or command Prompt and connect via SSH

Note: If you are using ubuntu server then use ubuntu@your-instance-public-ip instead of ec2-user

Step 3: Install Apache webserver

  1. First of all update your system
  • For Amazon Linux [Httpd]
  • For Ubuntu Linux [ Apache2]

2. Install Apache webserver

  • For Amazon Linux
  • For Ubuntu Linux

3. Start Apache service and enable it

  • For Amazon Linux
  • For Ubuntu Linux

Step 4: Verify default Apache webserver

  • After install the Apache webserver
  • Copy the public IP of EC2 instance and paste it in browser

Finally, you have successfully deploy Apache webserver on AWS EC2 instance . Now, you can host your website or web application easily and quickly.

One thought on “Setup Apache Web Server on AWS EC2 – Step by Step

Leave a Reply

Your email address will not be published. Required fields are marked *