Through this post, I will guide you on how to install Apache on Ubuntu. Just Follow these Simple steps mentioned in this article
We know that the Apache HTTP server is the most widely-used web server in the world. It is an open-source web server that’s available for Linux based servers at no cost.
It was launched in 1995 and become the most popular web server on the internet since April 1996
The latest released version is of Apache HTTP Server (“httpd”) is 2.4.41
Step #1 — Installing Apache on Ubuntu
First of all, we need to update the local package index by executing the below commands:
sudo apt update sudo apt install apache2
if you have the UFW firewall enabled and running on your system, then you need to open the ports 80 and 443 to allow client requests to Apache web server via HTTP and HTTPS respectively, then reload the firewall settings using following commands:-
sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw reload
Step #2 — Check Apache Web Server status on Ubuntu
After the successful installation Apache on Ubuntu, the web server service should be started automatically, you can check if it is up and running with the following command.
sudo systemctl status apache2
If Apache is running then you will see the output on the console as shown in below image
To verify Apache 2 installation is working fine, open a web browser and enter the following URL to access the Apache default web page.
If you see this page, it means your Apache web server is working fine. It also provides you some basic information about important Apache configuration files and directory locations.
How to Start/Restart Apache Web Server on Ubuntu
You can start apache server by running below command
sudo service apache2 start sudo service apache2 restart