How to install Apache Server on Ubuntu 24.04 Noble LTS

Getting an HTTP server using Apache on Ubuntu 22.04 is one of the easiest things to do using the command terminal, it is because the default repository of Ubuntu offers all the necessary packages to set up an Apache server. Also, it is the most widely used web server that is open source and cross-platform supported with highly customizable capabilities for hosting various websites, content management platforms, and web applications. Here in this tutorial, we quickly go through the commands involved in the installation of the Apache HTTP server on Ubuntu 24.04 LTS.

Step 1. Update your package index

On your Ubuntu server or desktop access the command terminal, once you have that, first run the system update command given in this step. It will not only index the latest available package available through the system repositories but also install the security and other package updates.

sudo apt update && sudo apt upgrade -y

Step 2: Installing Apache on Ubuntu 24.04

As in the introduction of this tutorial, we have discussed that Apache web server packages to install it are already available to download through the default system repositories, therefore, use the APT package manager command as given below:

sudo apt install apache2
Installaing Apache Ubuntu 24.04 server

Step 3: Verify Apache Installation:

The service of Apache would not be started automatically after completing the installation process, therefore, first start and enable using the command and then verify the same.

sudo systemctl start apache2
sudo system enable apache2

Verify:

systemctl status apache 2 --no-pager -l
Check Apache service status Ubuntu 24.04

Step 4: Configure Firewall:

By default, the ports 80 and 443 will already be opened on the Ubuntu 24.04 server, however, if you are using Cloud Service then need to open these two ports in your Cloud provider’s firewall. Whereas, those who are using UFW firewall on their system can use the given command:

sudo ufw allow 'Apache'

Step 5: Access Apache Default Page:

Once you have completed the installation we can further verify whether it is working fine by accessing the test page it offers. For that, open your local browser that can access the IP address of Ubuntu 24.04 or the domain that pointed to it. Then go to the URL section and type any of them:

http://your-ubuntu-24.-04-ip-adress
or
http ://your-domain.com
Default Apache web server test page

Apache’s configuration files, website files, and logs are located in the /etc/apache2, /var/www/html, and /var/log/apache2 directories, respectively. You can explore them, if needed to configure some web applications.

Well, we have just discussed the installation of the Apache web server on Ubuntu 24.04, if you are planning to install some PHP-based application then you will need to configure the LAMP server on your Ubuntu 24.04 Linux…

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.