Systematic error analysis Apache2
Datum
πΉ Troubleshooting
We proceeded step by step, as if we were investigating a crime scene π΅οΈβοΈ:
- Check installation & basic status
dpkg -l | grep apache2 systemctl status apache2 apachectl configtest
β Everything installed, config syntactically OK, but service inactive.
Check logs
journalctl -u apache2 -n 50 tail -n 50 /var/log/apache2/error.log
β No entries β Indication of very early startup termination
Check modules
apachectl -M
β Load all modules, no visible crash
β Problem occurs after module load
Direct foreground test
sudo /usr/sbin/apachectl -e debug -DFOREGROUND
β Start aborts after module load
β No logs β Very typical for runtime dir / envvars problem
Minimal start isolated
sudo /usr/sbin/apache2 -X
β Error message
${APACHE_RUN_DIR} is not definedβ Runtime directory / envvars
LDAP configuration analysis
grep -R βldapβ /etc/apache2
β Active LDAP modules that did not have a server, possible second startup problem
Load envvars
source /etc/apache2/envvars /usr/sbin/apache2 -DFOREGROUND
β Now running without errors β envvars problem confirmed
Deactivate LDAP modules
sudo a2dismod ldap authnz_ldap ldap_userdir vhost_ldap
β System startup possible, no further crashes
Start Apache via systemd
sudo systemctl restart apache2 sudo systemctl status apache2
β Stable service, port 80 occupied, everything running
πΉ Conclusion
Main problem: envvars / runtime directory not set β startup aborted
Secondary problem: LDAP modules active without LDAP β immediate crash
Symptomatic consequences: No logs, no port binding, exit code 1
Solution: Load envvars + deactivate LDAP modules β Apache runs stably again







