宅基地的所有设置完成后无法启动 http://homestead.app

Unable to launch http://homestead.app after all setup of homestead done

我是宅基地的新手。我用 VitualBox 和 Vagrant 完成了宅基地的所有设置。 Vagrant 启动后,我在终端中收到以下消息:

vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'hashicorp/precise64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default: 
    default: Guest Additions Version: 4.2.0
    default: VirtualBox Version: 5.1
==> default: Mounting shared folders...
    default: /vagrant => /home/prabhu
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.

但仍然无法启动 homestaed.app 或出现任何错误。 请帮忙

假设您使用的是 Linux 或 Mac, 如果是这样,您必须 "route" homestead.app 到您的机器。

已完成编辑 /etc/hosts 并添加此行:

192.168.10.10    homestead.app

默认情况下,homestead 使用 192.168.10.10 作为机器,所以它应该可以工作。


编辑:

在虚拟机中新建项目

  • 在您的 homestead 文件夹中执行 vagrant ssh 以使用 ssh 连接到计算机
  • composer create-project laravel/laravel your-project-name

然后,一定要link你的项目文件夹和虚拟机中的项目文件夹。

检查你的 Homestead.yaml

上是否有这个
folders:
- map: ~/your-project-folder
  to: /home/vagrant/your-project-folder

其中 map 是您的本地文件夹,to 是将在虚拟机中创建的文件夹。

然后,编辑您的 Homestead.yaml 并为您的项目创建一个新的 site,我的看起来像那样

 sites:                                                                        
  - map: development.app                                                    
    to: /home/vagrant/plannerking/public                                    
  - map: vetur.app                                                          
    to: /home/vagrant/vetur/public                                          
  - map: mailprocess.app                                                    
    to: /home/vagrant/mailprocess/public                                    

最后,在 /etc/hosts 中写入您的新项目的名称 ex: mailprocess.app 并将其路由到虚拟机。

192.168.10.10    mailprocess.app

一切都很好解释here

不要使用 .app 等 gTLD 域名后缀,请使用 .test.local