laravellaravel-4vagrantlaravel-5homestead

Homestead multiple sites not working


I'm a newbie on laravel, and running homestead I had one site before added another one did not work. I destroyed homestead and started once again and added two sites in Sites section in homestead.yaml file the bluprint of my homestead.yaml file is below

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

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

sites:
    - map: project1.dev 
      to: /home/vagrant/laravel/project1/public

    - map: project2.dev 
      to: /home/vagrant/laravel/project2/public

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 93000
#       to: 9300
#     - send: 7777
#       to: 777
#       protocol: udp

I added those two sites in my /etc/hosts file as well blueprint is below

#laravel maps
192.168.10.10 project1.dev
192.168.10.10 project2.dev

but when i run project1.dev or project2.dev they both show me the content of project1.dev files

Any Idea?


Solution

  • I think I needed to the vagrant provision command to restart the server and register the changes that I have made

    so once you finished with homestead.yaml and /etc/hosts file run this

    vagrant provision