I am trying to set up a virtualhost on my apple mac on localhost. The server is provided by XAMPP, which bundles Apache/MySQL/PHP in one bundle.
Here is what I have done
Try leaving the the setting for "localhost" at the end of the file "httpd-vhosts.conf", i.e.:
#
# Virtual Hosts
#
...
# others vhost
...
# localhost
ServerName localhost
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
Options Indexes FollowSymLinks Includes execCGI
AllowOverride All
Order Allow,Deny
Allow From All
#end of httpd-vhosts.conf file
Worked for me, greetings!