Install Apache on Ubuntu Linux

Today we will learn Apache installation on Ubuntu. Apache is free and open source web server. So let’s get started

Step 1: Open Terminal

Open Terminal, You can open it through the system Dash or the Ctrl+Alt+T shortcut.

Step 2: Update system repositories

Download the latest version of a software by first updating the local package index of Ubuntu repositories. Open the Terminal and enter the following command in order to do so:

sudo apt update

Step 3: Install Apache

Next, enter the following command as sudo in order to install Apache2 and its required dependencies:

sudo apt install apache2

You may be prompted with a y/n option to continue installation. Please enter Y, after which the installation procedure will begin.

Step 3: Verify the Apache installation

Run below command to check the Appache is installed or not

apache2 -version

The above command will give below output

Now, You have successfully install the Apache but you can’t access it from outside. To do so we need to update firewall setting

Configure the Firewall Settings

Step 1: List the UFW application profiles

In order to configure the firewall, let us first list the application profiles we will need to enable access to Apache. Use the following command to list such available applications:

sudo ufw app list

Step 2: Allow Apache Full on UFW

Allowing Apache Full on UFW will open port 80 and 443 for network traffic, while providing maximum security to the server. Please configure UFW to allow Apache Full through the following command:

sudo ufw allow 'Apache Full'

Step 3: Verify that the Apache service is running

sudo systemctl status apache2

Congrats!! You have successfully install apache on ubuntu. Now open browser and hit ipaddress it will display default Apache page like below

If you have any questions or thoughts to share, use the comment form below to reach us.

Comments are closed.