一、修改Apache "DocumentRoot"
1.sodu vi/etc/apeche2/httpd.conf #开启virtual hosts模块
Include /private/etc/apache2/extra/httpd-vhosts.conf
2.sodu vi/etc/apache2/extra/httpd-vhosts.conf #添加虚拟服务器的root路径
<VirtualHost *:80>
DocumentRoot "/Users/username/path/"
ServerName www.haosheng.com
</VirtualHost>
3.sodu vi/etc/apache2/extra/httpd-userdir.conf #开启目录访问权:
<Directory "/Users/username/path>
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>