Installing Apache on Ubuntu 16, 14, or 12

To install the default version of Apache (Ubuntu 14, 16—Apache 2.4, Ubuntu 12—Apache 2.2):

Step 1: Install Apache

apt-get -y install apache2

Step 2: Verify the installation.

apache2 -v

The result displays similar to the following:

Server version: Apache/2.4.18 (Ubuntu)
Server built: 2016-04-15T18:00:57