macOS Sierra - localhost stops working when virtual host is enabled
Probably you missed one or more modifications. To enable virtual hosts in macOS 10.12.0 (Client) do the following:


edit the file /etc/apache2/httpd.conf:

uncomment line 160:

#LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so


to

LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so


replace in line 213

#ServerName www.example.com:80


by

ServerName localhost


uncomment line 509:

#Include /private/etc/apache2/extra/httpd-vhosts.conf


to

Include /private/etc/apache2/extra/httpd-vhosts.conf

edit the file /etc/apache2/extra/httpd-vhosts.conf and replace the content by

&lt;VirtualHost *:80&gt;
    ServerName localhost
    DocumentRoot "/path/to/localhost"

    &lt;Directory "/path/to/localhost"&gt;
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
        Require all granted
    &lt;/Directory&gt;
&lt;/VirtualHost&gt;


Your site has to reside in /path/to/localhost/
Check the apache config with: sudo apachectl -S. The first two lines should yield:

VirtualHost configuration:
*:80                   localhost (/private/etc/apache2/extra/httpd-vhosts.conf:23)

Start apache with sudo apachectl start
Now – after emptying the browser caches – enter localhost in the address bar of your browser.