Localhost refuses to connect after upgrading to Sierra OS
After updating to macOS Sierra, Apache httpd moves the old httpd.conf to httpd.conf.pre-update and place the new one. In order to work the localhost work please try the below procedure:

cd /etc/apache2/  
sudo mv httpd.conf httpd.conf-afterupdate  
sudo mv httpd.conf.pre-update httpd.conf  
sudo apachectl configtest  
sudo apachectl restart  


Then test:

curl -I -L localhost