在10.8以后, 需要
1. nano /etc/apache2/users/pengcheng.conf
在其中加入, 其中pengcheng/Sites这个文件夹如果不存在, 可以自行建立.
<Directory "/Users/pengcheng/Sites/">
Options Indexes Multiviews
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
</Directory>
2. sudo apachectl start
3. 这时如果apache运行正常, 应该可以访问 http://127.0.0.1/, 返回it works.
4. 想要暴露的东西放在/Users/pengcheng/Sites下, 比如/Users/pengcheng/Sites/folder1/text1.txt
那么可以访问http://127.0.0.1/~pengcheng/folder1/text1.txt