DEV Community

Surav Shrestha
Surav Shrestha

Posted on β€’ Edited on

2

Install Apache Web Server in Ubuntu AWS EC2 Instance

Apache Web Server

Introduction

Installing a web server is a foundational step in web development and server management. Apache is one of the most popular web servers due to its reliability and extensive features. In this guide, we'll walk you through the steps to install and configure the Apache Web Server on an Ubuntu AWS EC2 instance.

Prerequisites

Before we begin, ensure you have the following:

  1. An AWS account
  2. An EC2 instance running Ubuntu

Step 1: Launch and Connect to EC2 Instance

For detailed instructions on launching and connecting to an AWS EC2 instance, you can refer to this article: Launch and Connect to AWS EC2 Instance.

Step 2: Update Your Instance

Once connected to your EC2 instance, update the package lists:



sudo apt update


Enter fullscreen mode Exit fullscreen mode

Step 3: Install Apache Web Server

Now, install Apache using the package manager:



sudo apt install apache2 -y


Enter fullscreen mode Exit fullscreen mode

Step 4: Verify Apache Installation

You can verify that Apache is running by accessing your instance’s public IP address in a web browser:



http://ec2-18-208-219-229.compute-1.amazonaws.com


Enter fullscreen mode Exit fullscreen mode

Apache2 Default Page

You should see the default Apache2 Ubuntu Default Page, indicating that Apache is successfully installed and running. πŸŽ‰

Note: The webpage is served from the /var/www/html/index.html file in the EC2 instance. You can edit this file to customize the content as desired.

Conclusion

You’ve successfully installed and configured the Apache Web Server on your Ubuntu AWS EC2 instance. This setup can now serve as the foundation for your web applications. 🌐

Additional Resources

If you have any questions or run into issues, feel free to leave a comment below.

Happy coding! πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

πŸ‘‹ Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay