Categories: TutorialsUbuntu

How to install Apache web server on Ubuntu 22.04

Webpages on the internet are predominantly served by a web server. The widely used web server is Apache (HTTP), an open-source and free server sponsored, maintained, and developed by the Apache Software Foundation. Apache is available on most Linux distributions, including Ubuntu, RHEL, and Fedora, although packaged differently. Powering over 50% of global websites, the Apache web server boasts robust features like reliable media support and dynamically loadable modules. Renowned for its flexibility and performance, Apache has seamlessly integrated with other popular software.

Configuring a web server in Ubuntu is generally straightforward. However, Apache’s configurations can vary to accommodate requests from multiple domains. It also supports encryption (HTTPS) and provides website security through various authentication methods.

Sponsored

This guide aims to elucidate the installation and configuration of an Apache web server on Ubuntu.

1. Apache Installation

Apache is available in Ubuntu’s default software repositories, allowing installation like any other package via package management tools. Update the local package repository by executing the following terminal command:

sudo apt update

Now, proceed to install the Apache web server with the command:

sudo apt install apache2

After installation, check the version of the installed apache2 web server:

apache2 -version

Read: How to set up an SMTP server on Ubuntu 22.04

2. Firewall Configuration

To enable access to Apache, display the application profiles for firewall configuration using the command:

sudo ufw app list

Sponsored

The output shows three Apache profiles: Apache, Apache Full, and Apache Secure, each providing different security levels. Enabling the most restrictive profile, which opens Port 80 for traffic, is accomplished with the command:

sudo ufw allow ‘Apache’

Verify that Apache has been enabled on the firewall by running:

sudo ufw status

Read: How to Install Redis Server on Ubuntu 22.04

3. Apache Web Server Configuration

Ensure the Apache web server is running before configuring settings:

sudo systemctl status apache2

Confirm that the status is active (running).

The post How to install Apache web server on Ubuntu 22.04 appeared first on net2.

Ubuntu Server Admin

Recent Posts

Canonical Releases Ubuntu 25.04 Plucky Puffin

The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…

3 days ago

Ubuntu 25.04 (Plucky Puffin) Released

Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…

4 days ago

Extended Security Maintenance for Ubuntu 20.04 (Focal Fossa) begins May 29, 2025

Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…

4 days ago

Ubuntu 20.04 LTS End Of Life – activate ESM to keep your fleet of devices secure and operational

Focal Fossa will reach the End of Standard Support in May 2025, also known as…

5 days ago

Ubuntu MATE 25.04 Release Notes

Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…

5 days ago

Ubuntu Weekly Newsletter Issue 887

Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…

6 days ago