DEV Community

Surav Shrestha
Surav Shrestha

Posted on • Edited on

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! 👩‍💻👨‍💻

Top comments (0)