Apache 2 on Ubuntu

Your quick guide to installing and managing the world's most popular web server.

What is Apache 2?

The Apache HTTP Server, colloquially called Apache, is a free and open-source cross-platform web server software. It is fast, reliable, and secure. When combined with Ubuntu, it provides a highly stable environment for hosting websites and web applications.

Installation Guide

Installing Apache 2 on Ubuntu is incredibly straightforward using the default package manager, apt. Follow these steps in your terminal:

1. Update your local package index:

sudo apt update

2. Install the apache2 package:

sudo apt install apache2 -y

Adjusting the Firewall

If you are using UFW (Uncomplicated Firewall), you need to allow HTTP and HTTPS traffic to access your web server.

Allow Apache through the firewall:

sudo ufw allow 'Apache Full'

Verify the status:

sudo ufw status

Managing the Apache Process

Once your server is up and running, you can manage the Apache service using systemctl commands.

Testing Your Server

To verify that Apache is working correctly, open your web browser and navigate to your server's public IP address or http://localhost if you are on the same machine. You should see the default Apache2 Ubuntu Default Page.