参考:http://www.cnblogs.com/snandy/archive/2012/11/13/2765381.html
1. 启动 Apache 服务
$ sudo apachectl start
在浏览器中输入:http://localhost/
显示:It works!
2. 查看IP地址
$ ifconfig | grep "inet " | grep -v 127.0.0.1
输出:inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
在浏览器中输入:http://192.168.1.100/
显示:It works!
3. 给当前用户设置文件读写权限
1) 打开 Apache 的默认根目录
$ open /Library/WebServer/Documents/
2) 设置读写权限
右击 “Documents” -> "Get Info"
3) 图示
4. 测试
在 Documents 下创建站点 site,及文件 site/1.html,见图
访问:http://192.168.1.100/site/1.html