Homestead - 自动Windows主机配置

时间:2015-08-26 11:29:43

标签: vagrant yaml hosts homestead

VVV使用vagrant-hostsupdater插件自动配置主机。在更改Homestead.yaml文件后,Homestead是否有方法执行此操作?

1 个答案:

答案 0 :(得分:1)

在homestead.rb

中添加
if Vagrant.has_plugin?("vagrant-hostsupdater") && settings["hosts_file_additions"] == true
     hosts = []
     settings["sites"].each do |site|
      hosts.push(site["map"])
    end
     config.hostsupdater.aliases = hosts
 end

在Homestead.yaml中添加此内容

sites:
    - map: yourdevdomain.app
      to: /home/www/laravel/public
      hosts: 192.168.88.88

hosts_file_additions: true

你已经完成了! 以下是详细教程:https://aslamise.blogspot.com/2016/10/laravel-homestead-and-vagrant-hostsupdater-plugin.html