Vagrant 流浪汉/木偶:vhost“;网站不可用“;

Vagrant 流浪汉/木偶:vhost“;网站不可用“;,vagrant,vhosts,puphpet,Vagrant,Vhosts,Puphpet,所以我在几台Mac和PC上使用vagrant进行本地开发 puphpet/config.yaml中的vhost如下所示 piYyhCPLFha4: servername: iamsumit.dev serveraliases: - www.iamsumit.dev docroot: /var/www/iamsumit/dist port: '80'

所以我在几台Mac和PC上使用vagrant进行本地开发

puphpet/config.yaml
中的vhost如下所示

        piYyhCPLFha4:
            servername: iamsumit.dev
            serveraliases:
                - www.iamsumit.dev
            docroot: /var/www/iamsumit/dist
            port: '80'
            setenv:
                - 'APP_ENV dev'
            override:
                - All
            options:
                - Indexes
                - FollowSymLinks
                - MultiViews
            engine: php
            custom_fragment: ''
            ssl_cert: ''
            ssl_key: ''
            ssl_chain: ''
            ssl_certs_dir: ''

        piYyhCPLFha5:
            servername: relocation.dev
            serveraliases:
                - www.relocation.dev
            docroot: /var/www/moovel/relocation-app/dist
            port: '80'
            setenv:
                - 'APP_ENV dev'
            override:
                - All
            options:
                - Indexes
                - FollowSymLinks
                - MultiViews
            engine: php
            custom_fragment: ''
            ssl_cert: ''
            ssl_key: ''
            ssl_chain: ''
            ssl_certs_dir: ''

        piYyhCPLFha7:
            servername: einzl.dev
            serveraliases:
                - www.einzl.dev
            docroot: /var/www/einzl/dist
            port: '80'
            setenv:
                - 'APP_ENV dev'
            override:
                - All
            options:
                - Indexes
                - FollowSymLinks
                - MultiViews
            engine: php
            custom_fragment: ''
            ssl_cert: ''
            ssl_key: ''
            ssl_chain: ''
            ssl_certs_dir: ''
现在我的问题是,我无法让中间vhost
relocation.dev
在特定的mac上工作(在所有其他机器上都能完美工作)

其他虚拟主机工作正常。只是那个vhost不起作用。浏览器将加载很长时间,然后向我显示“网站不可用”消息

这是我的主机文件:

##
# 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
255.255.255.255 broadcasthost
::1             localhost
192.168.56.102 einzl.dev
192.168.56.102 boss.dev
192.168.56.102 iamsumit.dev
192.168.56.102 relocation.dev
192.168.56.102 nephalem.dev
192.168.56.102 polygoncreator.dev
192.168.56.102 car2clean.dev
192.168.56.102 elearning.dev
docroot是正确的。我无法想象是什么原因导致puphpet/流浪汉不认识这一个。
什么会导致这种行为?

经过大量研究,我发现
.htaccess
文件中的这两行(必要的重定向)导致页面不再加载:

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
为什么?因为子域
www.relocation.dev
不在我的主机文件中。 主机文件行应如下所示:

192.168.56.102 relocation.dev www.relocation.dev
现在一切正常


感谢@v2p抽出您的时间。

此站点的apache错误日志包含哪些内容?在您的虚拟机中。文件为空的文件可能位于:/var/log/apache2/piYyhCPLFha5-error.log中
..5-access.log
有以下三行:
192.168.56.1---[14/Apr/2015:09:55:41+0000]“GET/HTTP/1.1”301 228“-”Mozilla/5.0(Macintosh;Intel Mac OS X 10_10_3)AppleWebKit/537.36(KHTML,像Gecko)Chrome/41.0.2272.118 Safari/537.36“