vagrant

Windows 上安装 Laravel Homestead

2016-11-22  本文已影响106人  A_Coder

vagrant box add laravel/homestead
cd D:
git clone https://github.com/laravel/homestead.git Homestead
bash init.sh
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
    - ~/.ssh/id_rsa
folders:  #windows和hometead两个系统共享一个文件夹,映射
    - map: D:/LaravelWorkSpaces  #这个是项目的地址,例如D:\随便\项目的目录 1
      to: /home/vagrant/Code #这个是homestead系统的地址
sites:   #sites属性可以帮助你可以轻易指定一个 域名来对应到 homestead 环境中的一个目录上,可以设置多个应用的地址
    - map: homestead.app   #这个是你项目要设定在你的浏览器上的地址
      to: /home/vagrant/Code/blog/public
    - map: blog.app   #这个是你项目要设定在你的浏览器上的地址
      to: /home/vagrant/Code/blog/public

      #- map: leimu.local
      #  to: /home/vagrant/Code/leimu/public
databases:
    - homestead
# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar
# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp

必须将在 Nginx sites 中所添加的「域名」也添加到你本机电脑的 hosts上。hosts文件会将请求重定向至 Homestead 环境中设置的本地域名。

192.168.10.10 homestead.app
92.168.10.10   blog.app
vagrant up
$ vagrant ssh
Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-38-generic x86_64)
    Documentation:  https://help.ubuntu.com
    Management:     https://landscape.canonical.com
    Support:        https://ubuntu.com/advantage
4 packages can be updated.
0 updates are security updates.
Last login: Tue Nov 22 02:10:45 2016 from 10.0.2.2

参考:Laravel Homestead

上一篇下一篇

猜你喜欢

热点阅读