1、
找到 /Applications/MAMP/conf/apache/httpd.conf
搜索httpd-vhosts.conf 找到:#Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
将#去掉,
使虚拟地址的配置文件生效。
2、找到
/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
添加如下
<VirtualHost *:80>
DocumentRoot “/Applications/MAMP/htdocs/basic/web”
ServerName commerce
</VirtualHost>
3、找到 /etc/hosts
添加127.0.0.1 commerce
重启apche服务器