(1) First check whether the *.conf has read and write permissions, if you do not want to give the file read and write permissions, such as
sudo chmod 777 localhost.conf
(2) to see if the/users/username/sites/localhost/folder has a index.html file, if not, create one, the default is to open the index.html file
(3) Last view of the localhost configuration file
For OSX 10.9 Apache 2.2
<virtualhost *: the>DocumentRoot"/users/xx/sites/localhost"ServerName localhost errorlog"/users/xx/sites/logs/localhost-error_log"Customlog"/users/xx/sites/logs/localhost-access_log"Common<directory"/users/xx/sites/localhost">Order deny,allow allow from all</Directory></VirtualHost>
For OSX 10.10 Apache 2.4
<virtualhost *: the>DocumentRoot"/users/xx/sites/localhost"ServerName localhost errorlog"/users/xx/sites/logs/localhost-error_log"Customlog"/users/xx/sites/logs/localhost-access_log"Common<directory"/users/xx/sites/localhost">Require All granted</Directory></VirtualHost>
(4) Finally restart Apache
sudo apachectl restart
Mac OSX Forbidden you don't have permission to access/on this server workaround