Homestead初始化工具
打开Git Bash,在命令行输入下列命令:
~~~
cd ~ //切换到家目录,对于Win7的administrator用户来说,家目录就是C:\Users\Administrator。
git clone https://github.com/laravel/homestead.git Homestead //将homestead项目克隆到家目录的Homestead目录下
~~~
克隆完成后,执行如下命令:
~~~
// Mac/Linux...
cd Homestead
bash init.sh
// Windows...
cd Homestead
init.bat
~~~
![](https://box.kancloud.cn/ac7e892d311be0a18b0efaff723a45c1_595x328.png)
此命令会在当前目录下生成Homestead.yaml配置文件,内容按如下修改:
![](https://box.kancloud.cn/091547e52c2bcf0e867ba3aceab7c24c_794x624.png)
~~~
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: E:/code //这里指向的是你本机的代码目录
to: /home/vagrant/code //这里意思是将你的本机代码目录映射到到homestead主机的目录
sites:
- map: homestead.app //域名
to: /home/vagrant/code/demo/public //域名指向的代码目录
- map: someline.app
to: /home/vagrant/code/someline-starter/public
databases:
- homestead //要添加的数据库写在这里
- someline
~~~