π ~1 min read
Table of contents
Symptom & Impact
Requests serve the wrong website or default page, breaking routing and SSL host expectations.
Environment & Reproduction
Ubuntu 16.04 apache2 with multiple vhosts and duplicated ServerName/ServerAlias entries. Reproduce by enabling conflicting site configs.
Root Cause Analysis
Apache selects an unintended virtual host due to configuration precedence, duplicate names, or missing NameVirtualHost-era migration cleanup.
Quick Triage
Run apache2ctl -S and inspect /etc/apache2/sites-enabled symlinks. Validate syntax with apache2ctl configtest.
Step-by-Step Diagnosis
Review each vhost file for ServerName uniqueness, port bindings, SSL cert paths, and include order interaction with 000-default.

Solution – Primary Fix
Set explicit unique ServerName values, disable conflicting sites with a2dissite, enable correct site with a2ensite, then systemctl reload apache2.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Migrate front-end routing to nginx reverse proxy, keeping Apache as backend app server where operationally simpler.
Verification & Acceptance Criteria
Host header tests return expected site content and certificates for all configured domains.
Rollback Plan
Re-enable previously active site symlinks and restore backed-up vhost files, then reload Apache.
Prevention & Hardening
Adopt naming conventions and CI lint checks for vhost uniqueness. Keep site enable/disable actions under change control.
Related Errors & Cross-Refs
Related to Let’s Encrypt challenge failures, 403 on DocumentRoot, and PHP-FPM backend socket errors.
Related tutorial: View the step-by-step tutorial for Ubuntu 16.04 LTS.
View all Ubuntu 16.04 LTS tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Apache VirtualHost docs, apache2ctl usage, and web stack configuration standards.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.