How to Install and Customize Apache on Ubuntu or Debian? (original) (raw)

Last Updated : 23 Jul, 2025

One of the most dominant forces in web server software is the Apache HTTP Server, often shortened to Apache. This free and open-source project, overseen by the Apache Software Foundation, has been a major player in shaping the Internet since its launch in 1995. Installing an Apache web server on Ubuntu or Debian is a straightforward process, but the specific commands might differ slightly depending on your Linux distribution. In this article, we will install Apache Web Server on various Linux distributions like Ubuntu, Debian, etc.

**Steps to Install Apache Web Server in Linux (Debian)

Step 1: Check your Linux distribution.

grep -E '^(VERSION|NAME)=' /etc/os-release

bd6ebecf-6730-4e44-8094-4061e4526b56

Checking linux distribution (Linux Mint Debian OS)

Step 2: Update Your System.

sudo apt update && sudo apt upgrade

Step 3: Install Apache Web Server

sudo apt install apache2 -y

Step 4: Enable the Services

sudo systemctl enable apache2

**Step 5: Test the Server by Hosting Simple Website

sudo mkdir /var/www/html/test_website

echo '

Example


GFG


This is a Apache Test Server for Ubuntu and Debian



' | sudo tee /var/www/html/test_website/index.html

Link: http://localhost/

WhatsApp-Image-2024-06-03-at-23410-PM

testing website on local server