Hi all,
I wanted to document an issue I just ran into after performing system updates on my HestiaCP server (Ubuntu 24.04) and share the solution that got me back online. Hopefully, this saves someone elses time!
The Context
I ran a chain of maintenance commands to update the system and clean up packages:
sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt clean -y && sudo apt autoclean -y
The Issue
Immediately after this finished, Apache stopped working and all websites were unresponsive. When attempting to restart it via the HestiaCP GUI, I got the error:
Error: ERROR: Restart of apache2 failed.
Investigating via the CLI revealed that apache2 had essentially been uninstalled/masked, likely by the autoremove step (not sure about this though):
-
systemctl status apache2returned:○ apache2.service Loaded: masked (Reason: Unit apache2.service is masked.) Active: inactive (dead) -
apache2ctl -treturned:
Command 'apache2ctl' not found
The Solution (Could be incomplete?)
It seems the system marked the Apache binaries as unnecessary dependencies during the upgrade. To fix it, I had to unmask the service and reinstall the binaries + the PHP module.
Here are the steps I took:
1. Unmask and Reinstall
sudo systemctl unmask apache2
sudo apt update
sudo apt install apache2 libapache2-mod-php -y
2. Verify Port Configuration
I was worried that a fresh install would reset /etc/apache2/ports.conf to Listen on port 80 (which would conflict with Nginx). However, I checked my running ports:
sudo ss -tulpn | grep apache2
Output confirmed it was correctly listening on Hestia’s backend ports (8080/8443) and NOT port 80:
tcp LISTEN 0 511 10.0.0.206:8443 ...
tcp LISTEN 0 511 10.0.0.206:8080 ...
3. Rebuild Web Domains
To ensure all config files, SSL paths, and PHP versions were perfectly synced, I finished by running:
sudo /usr/local/hestia/bin/v-rebuild-web-domains admin
I had to redo step 3 for all users, but I am unsure if it was even needed.
Question:
Everything seems to be running fine now (sites are up, Hestia is happy).
Did I miss any critical cleanup steps? specifically, does apt install apache2 automatically pick up the previous Hestia configuration files without issue, or should I be looking for any specific “gotchas” regarding PHP versions or mods-enabled that might have been reset?
Thanks!