https://pan.baidu.com/s/1 jH6 o5 sa
VirtualBox-5.2.12-122591-Win.exe.zip Vagrant_2.1.1.x86_64.msi.zip
已保存我的百度网盘。(qq 登录)
http://download.fsdhub.com/lc-Homestead-6.1.1-2018090400.zip
e:
mkdir Homestead
cd Homestead
mkdir env
cd env
# 把 lc-Homestead-6.1.1-2018090400.zip 解压到 e:\Homestead\env
cd lc-Homestead-6.1.1-2018090400
# 导入 Box
Vagrant box add metadata.json
==> Vagrant: A new version of Vagrant is available: 2.2.1!
==> Vagrant: To upgrade visit: https://www.vagrantup.com/downloads.html
==> box: Loading metadata for box 'metadata.json'
box: URL: file://E:/Homestead/env/lc-Homestead-6.1.1-2018090400/metadata.json
==> box: Adding box 'lc/Homestead' (v6.1.1) for provider: VirtualBox
box: Downloading: virtualbox.box
box: Progress: 100% (Rate: 12.9 M/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'lc/Homestead' (v6.1.1) for 'VirtualBox'!
cd e:/Homestead
Git clone http://git.xmyunce.com/linson/Homestead bash
接下来我们需要初始化 Homestead:
cd bash
bash init.sh
运行以上命令后,会在 ~/Homestead 目录下生成以下三个文件:
---
ip: "192.168.56.10"
memory: 2048
cpus: 1
provider: VirtualBox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: E:/edison/shop
to: /home/Vagrant/code/shop
- map: E:/edison/zhy
to: /home/Vagrant/code/zhy
sites:
- map: shop.test
to: /home/Vagrant/code/shop/public
- map: zhy.test
to: /home/Vagrant/code/zhy/public
databases:
- shop
- zhy
Ethernet adapter VirtualBox Host-Only Network:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::8 ca4:dacb:943 a:75 a6%16
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
192.168.56.10 shop.test
SSH-keygen -t rsa -C "linson@qq.com"
PHP-fpm 的路径不对
默认用户名及密码,需手动创建数据库
DB_USERNAME=Homestead
DB_PASSWORD=secret
Vagrant provision
# 设置 root 密码
sudo passwd root
# 切换到 root
su root
# 连接 Vagrant
Vagrant SSH
# 开启 Homestead
Vagrant up
# 关闭 Homestead
Vagrant halt