Setting Up Apache Web Server from Scratch
This guide explains how to install and configure Apache on a Debian‑based system.
1. Update Your System
sudo apt update
sudo apt upgrade -y
2. Install Apache
sudo apt install apache2 -y
3. Start and Enable Apache
sudo systemctl start apache2
sudo systemctl enable apache2
4. Verify Apache Is Running
5. Enable the SSL Module
sudo a2enmod ssl
sudo systemctl restart apache2
6. (Optional) Install Certbot for HTTPS
sudo apt install certbot python3-certbot-apache -y
Follow the prompts to secure your server with Let's Encrypt if desired.