Vagrant - Homestead Setup Multiple sites

自古美人都是妖i 提交于 2019-12-09 06:17:35

问题


I have mapped the folders etc using the homestead.yaml;

ip: "192.168.10.10"

...

folders:
    - map: /Users/User/Desktop/folder/Homestead/First
      to: /home/vagrant/First

    - map: /Users/User/Desktop/folder/Homestead/Second
      to: /home/vagrant/Second

sites:
    - map: first.dev
      to: /home/vagrant/First/public

    - map: second.dev
      to: /home/vagrant/Second/public

But when i set up the hosts file, etc/hosts with my second.dev to 192.168.10.10 i find that the mapping goes to first.dev, not the mapping that i have set up for second.dev.

How can i go about making the mapping return the correct site?

EDIT: I am using Mac OS X.


回答1:


Using Vagrant commands

Run the command vagrant provision within terminal or your command prompt within the folder where homestead files are located.

Another equivalent command is vagrant up --provision this will provision the vagrant machine as well as run it.

Using Global Homestead

You can use the command homestead provision to re-provision the vagrant machine, regardless of the place you call it from within the terminal.

Alternatively, you can use the serve command to add the information to your Homestead.yaml file for you. Like so;

serve domain.app /home/vagrant/Code/path/to/public/directory

But add this to your hosts file so you can access the your app via domain.app in your browser.



来源:https://stackoverflow.com/questions/26672310/vagrant-homestead-setup-multiple-sites

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!