for centos use httpd in apache to debug why vhost is not working try apache2ctl -S or httpd -S
for xampp sudo mkdr /opt/lampp/apache2/conf/sites-enabled echo "IncludeOptional apache2/conf/sites-enabled/*.conf" >> /opt/lampp/apache2/conf/httpd.conf in etc_path config in browser add /opt/lampp in type text instead of apache2 enter xampp