Yosemiteでlocalhostを使う場合はこちらが参考になるかもしれません→MacOS X の Yosemite (10.10) で Sites ディレクトリを使って localhost をアカウント別に利用する方法
ついでに、
MacOS X の Mavericks (10.9) で Sites ディレクトリを使って localhost をアカウント別に利用する方法
目標
/Users/USERNAME/Sites/public
ここをドキュメントルートにする
httpd.conf
以下二箇所を変更。
$ sudo vi /etc/apache2/httpd.conf
----
1.
# DocumentRoot "/Library/WebServer/Documents"
DocumentRoot "/Users/USERNAME/Sites/public"
2.
# <Directory "/Library/WebServer/Documents">
<Directory "/Users/USERNAME/Sites/public">
USERNAME.conf
$ sudo vi /etc/apache2/users/USERNAME.conf
<Directory "/Users/USERNAME/Sites/public">
AllowOverride All
Options Indexes FollowSymLinks Multiviews
Require all granted
</Directory>
apachectl restart
$ sudo apachectl restart
テスト
該当のディレクトリになんか文字列を書いたindex.htmlでもおいて、http://localhost/index.htmlとか接続してみる。
index.htmlの内容が表示されたらOK