【问题标题】:OSX Mavericks - Set up Apache with subdomainsOSX Mavericks - 使用子域设置 Apache
【发布时间】:2013-11-26 08:47:08
【问题描述】:

我已经成功地在我的 Mac 上设置了一个运行 PHP 的本地服务器,但是我无法将额外的本地站点设置为子域(即 site2.localhost)

这是我目前所拥有的:

主机文件:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
127.0.0.1       site2.localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost

httpd-vhosts.conf:

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "/Users/user/Sites/site2"
    ServerName site2.localhost
</VirtualHost>

并且我在 httpd.conf 文件中取消了以下行的注释:

Include /private/etc/apache2/extra/httpd-vhosts.conf

我不确定还需要添加什么或需要添加的位置。

【问题讨论】:

    标签: php macos apache subdomain


    【解决方案1】:

    好吧,看来我需要更努力地看一下...事实上它设置正确,但由于某种原因,当我在浏览器中键入 site2.localhost 时,它默认为 https。

    通过手动输入http://site2.localhost 可以正常工作。

    【讨论】:

      猜你喜欢
      • 2013-08-22
      • 1970-01-01
      • 2014-09-14
      • 1970-01-01
      • 1970-01-01
      • 2012-03-13
      • 1970-01-01
      • 1970-01-01
      • 2012-06-24
      相关资源
      最近更新 更多