CentOS 7 Virtual Host Not Working

Apache virtual hosts not working on CentOS 7, or the default site disappearing after adding one? The catch-all VirtualHost fix that worked for me.

CentOS 7 Virtual Host Not Working

1- Enable Options +SymLinksIfOwnerMatch 2- See my Virtual Host example Add below code at beginning of the virtual host section:

<VirtualHost *:80> ServerName fail </VirtualHost>

Add below code to the end of the virtual host section:

<VirtualHost *:80> ServerAlias * </VirtualHost>

📝 A note from my own work, first published in 2020.

Akam Omer
Written by

Akam Omer

IT leader, engineer and security specialist from Erbil with 20+ years across higher education, telecoms, healthcare and government. Founder of BulkSMSIraq, VerifyWay and Kurd.ai.