如何在Mac OS中配置本地主机?

时间:2017-05-02 07:37:56

标签: macos apache virtualhost vhosts

我在/etc/hosts中进行了更改:

127.0.0.1       dev

在http.conf中取消注释后行:

Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

最后我在extra/httpd-vhosts.conf中进行了更改:

这是完整的代码:

<VirtualHost *:80>
    DocumentRoot /Applications/MAMP/htdocs/
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin someone@example.org
    DocumentRoot "/Applications/MAMP/htdocs/dev"
    ServerName dev
    ErrorLog "logs/dev.loc-error_log"
    CustomLog "logs/dev.loc-access_log" common
</VirtualHost>

重新启动Apache并尝试打开网址http://dev后,我什么都没得到。

如何解决这个问题?

0 个答案:

没有答案