Introduction

The Apache HTTP server is the most widely-used web server in the world. It provides many powerful features including dynamically loadable modules, robust media support, and extensive integration with other popular software.

In this guide, we’ll discuss how to install an Apache web server on your Ubuntu 17.04 server.

Step 1: Install Apache

$ sudo apt-get update
$ sudo apt-get install apache2

Step 2: Adjust firewall settings

Before we can test Apache, we need to modify our firewall to allow outside access to the default web ports. Assuming that you followed the instructions in the prerequisites, you should have a UFW firewall configured to restrict access to your server.

During installation, Apache registers itself with UFW to provide a few application profiles. We can use these profiles to simplify the process of enabling or disabling access to Apache through our firewall.

$ sudo ufw app list

// Example output

Available applications:
Apache
Apache Full
Apache Secure
CUPS
Nginx Full
Nginx HTTP
Nginx HTTPS
OpenSSH

As you can see there are three available profiles for Apache, for this tutorial we will only focus on one; Apache Full.
Apache Full: This profile opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS/SSL encrypted traffic)

$ sudo ufw allow 'Apache Full'

Step 3: Verify your Apache web server is available!

First, you need to verify that apache is indeed running:

$ sudo systemctl status apache2

Once you’ve verified that it is indeed running, now it’s time to open up your favorite browser.

Open up any browser of your choosing and type in the below:

http://server_domain_or_IP

You should see the apache test page below on your screen, if you do; good job!

small_apache_default