15

Hee guys, little question: So i have setup the Homestead 2.0 and everything is working fine. I wanted to add another project in the same code directory but link it to another url. So i added it in the sites list but when i visited laravel.app it all works fine, but when I visit larabook.app it shows me the laravel.app page! Both urls are linked to 192.168.10.10 in my /etc/hosts file.

I have tried restarting my mac and restarting the vm but nothing is working :'(

/etc/hosts

192.168.10.10 laravel.app
192.168.10.10 larabook.app

Homestead.yaml

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

sites:
    - map: laravel.app
      to: /home/vagrant/Code/Laravel/public
    - map: larabook.app
      to: /home/vagrant/Code/Larabook/public

databases:
    - homestead
    - larabook
bobbybouwmann
  • 883
  • 3
  • 12
  • 23

3 Answers3

38

Assuming your Homestead.yaml file above

type in:

$ vagrant global-status

will display something like;

id    name      provider   state   directory    
--------------------------------------------    
77c5c30  default   virtualbox running et....    

type in:

$ vagrant provision 77c5c30

Of course this assumes you only have 1 VM, if you have others then read the instruction when you run vagrant provision

Kevin
  • 13,233
  • 7
  • 49
  • 68
vic
  • 396
  • 3
  • 2
  • This is really working for Homestead 2. I had the same problem and tried to use `homestead` or `default` as Vagrant box name to provision it after adding new sites but the above method is working at the moment like a charm – Marcin Nabiałek Dec 07 '14 at 08:37
  • Worked using Homestead 2 and Vagrant 1.7 - What is really happening here? would love to know :) – Angad Dubey Apr 17 '15 at 00:04
  • This really helped me. Thanks a lot. Laravel guide should include this very crucial step. You're a genius to figure this out. – KalC Feb 21 '16 at 15:20
2

This works for me, and didn't lose the database:

$ homestead halt
$ homestead up --provision
Paul Roub
  • 35,100
  • 27
  • 72
  • 83
vukan
  • 191
  • 3
  • 11
0

Try this

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

    - map: ~/Code/Larabook
      to: /home/vagrant/Code/Larabook

sites:
    - map: laravel.app
      to: /home/vagrant/Code/Laravel/public
    - map: larabook.app
      to: /home/vagrant/Code/Larabook/public

databases:
    - homestead
    - larabook

Note: look at the changes i have made to the folders section. find out more from https://www.easylaravelbook.com/blog/configuring-multiple-laravel-homestead-sites-and-databases/#top

after run
    $ homestead halt
    $ homestead up --provision
Nanhydrin
  • 4,022
  • 2
  • 37
  • 49