homestead - 此网页不可用

homestead - This webpage is not available

不知道哪里卡住了,我已经用过了homestead,还是想不通。虚拟机正常运行,文件夹也正确镜像。

$ vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'laravel/homestead' 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: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 80 => 8000 (adapter 1)
    default: 443 => 44300 (adapter 1)
    default: 3306 => 33060 (adapter 1)
    default: 5432 => 54320 (adapter 1)
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> 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: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => C:/Users/Roko/Homestead
    default: /home/vagrant/Code => C:/Users/Roko/Homestead/Code
    default: /home/vagrant/Code/geogram => C:/Users/Roko/Homestead/Code/geogram
    default: /home/vagrant/Code/phpmyadmin => C:/Users/Roko/Homestead/Code/phpmyadmin
    default: /home/vagrant/Code/Laravel/public => C:/Users/Roko/Homestead/Code/Laravel/public
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.

我在主机文件中添加了条目:

127.0.0.1  phpmyadmin.app
127.0.0.1  homestead.app

这是 YAML 文件:


ip: "192.168.10.10"
memory: 1048
cpus: 1

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Homestead/Code
      to: /home/vagrant/Code


sites:
    - map: homestead.app
      to: /home/vagrant/Code/Laravel/public

    - map: phpmyadmin.app
      to: /home/vagrant/Code/phpmyadmin/


databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

而且我仍然得到此网页不适用于 http://homestead.app:8000/ 有人能找出我做错了什么吗?

你试过了吗vagrant reload --provision

你的 vagrant up 和 Homestead.yaml 配置没问题。但是您的主机文件中的 IP 地址应该是 192.168.10.10 因此要解决此问题,请相应地编辑主机文件 (阅读文档 https://laravel.com/docs/5.2/homestead

192.168.10.10 phpmyadmin.app
192.168.10.10 homestead.app

然后使用 provision

重新加载你的 vagrant
vagrant reload --provision

应该可以了。

在您的 /etc/hosts 中使用 192.168.10.10 例子.. 192.168.10.10 Laravel.app