宅基地 - 此网页不可用

时间:2015-03-06 13:08:05

标签: laravel vagrant virtualization 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.

我在hosts文件中添加了条目:

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/ 有人能弄清楚我做错了什么吗?

3 个答案:

答案 0 :(得分:1)

您是否尝试过vagrant reload --provision

答案 1 :(得分:0)

你的流浪汉和Homestead.yaml配置很好。但是你的hosts文件中的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

应该这样做。

答案 2 :(得分:-1)

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