Install Apache in Ubuntu 24.04

In this article, we cover how to install the Apache web server in the Ubuntu 24.04 release. The Apache HTTP Server is a part of LAMP configuration. It is one of the most popular web servers out there. LAMP stands for Linux, Apache, MySQL, and PHP.

At the time of writing v2.4.58 is its latest stable release.

Note: The following operations require Administrative rights. If you don’t have the necessary rights then, contact your System Administrator for assistance.

Install Apache in Ubuntu 24.04

The package is a part of the standard Ubuntu repository. So, update the repository first. Open a terminal and issue the following:

sudo apt update

Next, to install the Apache web server:

sudo apt install apache2

To check if the server is up and running:

sudo systemctl status apache2

It should be active (running).

Thereafter, open a web browser and enter http://localhost/ in the address bar. You should see: the Apache2 Ubuntu Default Page. It works!

This shows that our installation is working as intended.

In conclusion, we have covered here how to install the Apache web server in Ubuntu 24.04 release.

Additional Info:

Apache web server hosts the Apache2 Ubuntu Default Page in directory /var/www/html directory. The DocumentRoot directive in the file: /etc/apache2/sites-available/000-default.conf has the default value as /var/www/html

Apart from that, we can start, stop, enable, disable, and restart the Apache web server through the following commands:

sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl disable apache2
sudo systemctl enable apache2
sudo systemctl restart apache2

Similar Posts