MacOs 搭建 Homestead 环境
安装 virtualbox
安装 vagrant
安装 Homestead
下载 Homestead 脚本
cd ~
git clone https://gitee.com/summerblue/homestead.git Homestead
cd ~/Homestead
git checkout v13.2.1
bash init.sh
编辑 Homestead.yaml 文件
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
folders:
- map: ~/code
to: /home/vagrant/code
创建 code 文件夹
生成 SSH Key
查看主机上是否生成过 SSH Key
ls -al ~/.ssh
如果存在,跳过该生成步骤,如果不存在,则运行:
> ssh-keygen -t rsa -C "email@example.com"
Generating public/private rsa key pair.
站点配置
sites:
- map: homestead.test
to: /home/vagrant/code/Laravel/public
在主机中配置 hosts
文件:
192.168.56.56 homestead.test
启动 Homestead
cd ~/Homestead && vagrant up
vagrant ssh
重启 Homestead
cd ~/Homestead && vagrant provision && vagrant reload
创建 Laravel 应用
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer create-project laravel/laravel Laravel --prefer-dist "9.*"
更多精彩内容:各种AI课程、技能课程、黑科技软件、网站小程序源码、副业小项目、PPT模板等精品素材、电商课程、推广引流课程等,尽在 天边资源网 。