0

我不知道我在哪里卡住了,我已经使用了宅基地,无法弄清楚问题所在。虚拟机运行正常,文件夹也正确镜像。

$ 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

而且我仍然得到 This web page is not available for http://homestead.app:8000/ 有人能弄清楚我做错了什么吗?

4

3 回答 3

1

你试过了吗vagrant reload --provision

于 2015-11-27T14:18:09.157 回答
0

你的流浪汉和 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

然后使用规定重新加载您的流浪汉

vagrant reload --provision

那应该这样做。

于 2015-12-29T13:39:14.703 回答
-1

在 /etc/hosts 示例中使用 192.168.10.10 .. 192.168.10.10 Laravel.app

于 2016-03-28T14:51:40.810 回答