MAMP mac配置多站点

Apache 配置

进入 Applications/MAMP/conf/apache/ 下打开 httpd.conf 文件。

搜索 Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf ,去掉前面的注释,是虚拟主机文件生效。

用文本编辑器打开 extra 文件夹下的 httpd-vhosts.conf 。

修改如下:


    ServerAdmin bd.demo3.com
    DocumentRoot "/Users/zhangqiang/Desktop/demo-wwwroot/demo3"
    ServerName bd.demo3.com
#    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dbd.demo3.com-error_log"
    CustomLog "logs/dbd.demo3.com-access_log" common



    ServerAdmin bd.demo4.com
    DocumentRoot "/Users/zhangqiang/Desktop/demo-wwwroot/demo4"
    ServerName bd.demo4.com
    ErrorLog "logs/bd.demo4.com-error_log"
    CustomLog "logs/bd.demo4.com-access_log" common

开启服务即可

你可能感兴趣的:(MAMP)