【发布时间】: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