Apache Server Installation Guide

5 Minutes read
background effect
Top promotion

Introduction

Apache Server is an open-source application that can serve both static and dynamic web applications on the server. Apache is highly customizable and supports many extensions that help expand its functionality. Additionally, it can act as a reverse proxy or load balancer to serve web applications or backend services on the server.

In this article, we will learn how to install Apache Server on Ubuntu 24.04 and how to set up virtual hosts to securely deliver applications on the server.


Installing Apache

The Apache Server package is available in the default repositories for Ubuntu 24.04. Follow these steps to install the latest version of Apache using the default package manager APT and enable the server to start automatically on boot.

1. Update package list:

sudo apt update

2. Install Apache package:

sudo apt install apache2 -y

3. Verify the installed version of Apache:

apachectl -v

4. Allow HTTP connections on port 80 through the UFW firewall:

sudo ufw allow 80/tcp

Verifying Apache Server

Open the public IP address of your server in a web browser (such as Google Chrome) and ensure that the Apache default page appears:

http://SERVER-IP

 


Managing Apache Service

Apache runs under the systemd service manager, which controls the server’s operations. Follow the steps below to enable Apache to run automatically at startup and to check its status.

1. Enable Apache service to run automatically at server startup:

sudo systemctl enable apache2

2. Start the Apache server:

sudo systemctl start apache2

3. Check the status of the Apache service:

sudo systemctl status apache2

4. Stop the Apache server:

sudo systemctl stop apache2

5. Restart the Apache server:

sudo systemctl restart apache2

Conclusion

By following these steps, you have successfully installed the Apache Web Server on Ubuntu 24.04. Apache is one of the best solutions for serving web applications due to its high customizability and flexibility. After installation, you can begin setting up virtual hosts or making modifications to deliver your applications with the best performance and security.



Labixe host logo
LABIXE LTD - Company Num. 13706095