Virtual configuration hosts in vagrant homestead / laravel

3

I'm starting at Laravel and would like to organize my development environment using some " hosts " for my projects. I created the first project in laravel and after suffering a bit with its installation, it worked that was a beauty. I then started a new project, set up the homestead.yaml and hosts of my system, but when I try to access through the browser it still points to the first project. I tried to stop the artisan server but continued with the problem, I searched the internet and the solutions I found did not work. I use ubuntu 16.04 and laravel 5.2 with homestaed ( vagrant / virtualbox ). Below I transcribe some of the hosts and Homestead.ymal files so they can get an idea of how they were configured. I ask friends to try to solve this problem. Thank you.

[hosts]
# vagrant hosts
192.168.10.10 homestead.app
192.168.10.10 api.app
[homestead.yaml]
ip: "192.168.10.10"
folders:
- map: /home/<user>/Dropbox/Projetos/Laravel-PHP/Projetos
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
- map: api.app
to: /home/vagrant/Code/ApiTeste/public
    
asked by anonymous 15.07.2016 / 03:40

2 answers

0

Dude, you need to give the command vagrant init inside the folder of your project. Once this is done, a file named vagrantfile will be generated. You need to open this file and set the homestead box in it. I believe you have already done this with the first project.

    
16.12.2016 / 21:11
0

You need to provision again in the box, if the box is already started, you should use the vagrant reload --provision command from the command line on the host, it will read Homestead.yaml again and configure nginx properly.

Rebooting not is sufficient since the box is already provisioned and this step is ignored during startup.

If the machine is stopped you can also use the provision flag at startup for new settings to be read vagrant up --provision .

Probably this problem is already resolved, but here is the answer if someone has a similar problem in the future.

Curious that question with almost 2 years, came the first page when I'm trying to set up a box using laravel/homestead to run Magento2.

    
18.06.2018 / 00:43