The most widely-used web server is what we use the term Apache HTTP. The reasons for being so beneficial include having numerous strong features such as robust media support, dynamically loadable modules, and substantial integration with other well-liked and amateur software.
This guide is created to help you install an Apache web server on the Ubuntu 16 server.

 

Prerequisites

First of all, configure a frequent, continual, and non-root user with sudo privileges on the server. Moreover, non-vital and less essential ports should be blocked, so you need to configure a basic firewall. Consider learning firewall configuration before moving ahead. If you’re not aware of how to configure a regular user account and have no knowledge of setting up the firewall, please learn the primary server set up guide before reading this article.
After having the account established and available, start with logging in your non-root user.

 

Steps to follow

 

Step 1: Installing Apache

No extra things are needed to install Apache as it’s available in Ubuntu’s default store Just use the conventional tool created to manage things. Reflection the latest upstream changes are required and you can avail this by updating the local package. Afterward, the next step is to install the Apache2 package. Just confirm the installation and make sure all depended and required components have been installed.

sudo apt-get update
sudo apt-get install apache2

 

Step 2: Adjusting the Firewall

Modifying the firewall is essential since you need to permit access to the web ports. So, make sure you have done necessary editing before testing Apache. Just keep in mind the guidelines in the prerequisites and configure a UFW firewall because it’s essential to limit or stop access to the server.

sudo ufw allow 'Apache Full'
sudo ufw status

Status should show “Actve”.

 

 

Step 3: Checking the web server

Once you have finished the installation process, Ubuntu 16 will run Apache. Access the Apache landing page and check whether the program is running or not. You’re not limited to accessing apache landing pages because there are two other options either to check this: your server’s domain name and the IP address.
In case of not setting up a domain name, use server’s public IP address, alternatively. Figuring out IP address is not complicated as you may need a few command lines using some ways.

sudo systemctl status apache2

 

 

Step 4: Managing the Apache Process

After having the web server up and active, there are a few primary administration commands. Now, you have to check stopping, starting, and stopping then starting the web server.

Type these words to stop the web server:

sudo systemctl stop apache2

 

Once it stops, type to start it again

sudo systemctl start apache2

 

You will need typing these words for stopping then starting the web server

sudo systemctl restart apache2

Now you can access it by accessing your IP in Browser. For example http://$ip-here  (Replace $ip-here with your VPS/Server IP.

 

 

Conclusion

Congratulations. You have successfully installed the web server. There are several things to explore the type of content as well as you can benefit from the technologies to have greater and richer experience.