Install Apache HTTP Server on Debian 12
Step 1 – Install Apache
apt update && apt upgrade -y
apt install -y apache2
Step 2 – Start and enable the service
systemctl enable --now apache2
Step 3 – Open firewall ports
ufw allow 'Apache Full'
ufw reload
Step 4 – Verify
curl -I http://localhost
The main configuration file is /etc/apache2/apache2.conf and virtual-host definitions belong in
/etc/apache2/sites-available/.
Apache version
apachectl -v