Donec at mattis erat! Duis sed massa eget eros gravida vulputate nec ut ipsum.

Adding a new site to Laravel Homestead

If it has been a while since you set up the Laravel Homestead Vagrant you may have forgotten how to add new sites. Or maybe you have added new sites but they are not working. Below are the steps that always work for me on the Mac.

Open terminal then the Homestead.yaml file with your editor of choice.

sudo vim ~/.homestead/Homestead.yaml

Add the folders to map. If using vim as the editor you must press "i" to insert text

folders:
    - map: "/Applications/MAMP/htdocs/vagrant/temprano/cohesion-app/webservice"
      to: "/home/vagrant/cohesion-webservice"

Add the sites to map the domain name to the site. If using vim press "Escape" then ":wq" "enter" to save

sites:
    - map: "api.webservice.cohesion.app"
      to: "/home/vagrant/cohesion-webservice/public"

Now it is time to edit the hosts file and add the domain.

sudo vim /etc/hosts

Now add the Domain to your host file and save.

192.168.10.10 api.webservice.cohesion.app

Go to the directory containing your Homestead Vagrant installation and run the below command

MacBook-Pro:Homestead7 user$ vagrant up
MacBook-Pro:Homestead7 user$ vagrant provision
MacBook-Pro:Homestead7 user$ vagrant reload

Thats it. The domain should now work.

 

Latest News

Social GK5

Any data to display