homestead搭载laravle安装流程 for mac

1.在bash中执行, vagrant box add laravel/homestead

2.进入用户文件夹,即cd,后执行 git clone https://github.com/laravel/homestead.git Homestead

3.此时,会在用户主目录生成Homestead目录,进入该目录,执行bash init.sh,此时,会在用户主目录生成.homestead隐藏目录

4.进入.homestead隐藏目录,编辑配置文件Homestead.yaml,保存退出

5.根据对配置文件的修改创建相应的代码目录,并在hosts文件夹下添加IP与域名映射

6.生成ssh-key,即执行:ssh-keygen -t rsa -C 'you@homestead',此时会在用户主目录下生成.ssh隐藏目录,该目录内容与.homestead中配置文件有关

7.进入Homestead目录,执行vagrant up启动服务器,若启动出现下述错误:

vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Checking if box 'laravel/homestead' is up to date...
==> homestead-7: Clearing any previously set forwarded ports...
==> homestead-7: Fixed port collision for 80 => 8000. Now on port 2200.
==> homestead-7: Fixed port collision for 443 => 44300. Now on port 2201.
==> homestead-7: Fixed port collision for 3306 => 33060. Now on port 2202.
==> homestead-7: Fixed port collision for 5432 => 54320. Now on port 2203.
==> homestead-7: Fixed port collision for 22 => 2222. Now on port 2204.
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
    homestead-7: Adapter 1: nat
    homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
    homestead-7: 80 (guest) => 2200 (host) (adapter 1)
    homestead-7: 443 (guest) => 2201 (host) (adapter 1)
    homestead-7: 3306 (guest) => 2202 (host) (adapter 1)
    homestead-7: 5432 (guest) => 2203 (host) (adapter 1)
    homestead-7: 22 (guest) => 2204 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
==> homestead-7: Waiting for machine to boot. This may take a few minutes...
    homestead-7: SSH address: 127.0.0.1:2204
    homestead-7: SSH username: vagrant
    homestead-7: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
,可按以下步骤解决:

  1. Completely uninstall and reinstall Vagrant, VirtualBox, and Homestead.
  2. Ensure the homestead-7 box is shut down within the VirtualBox UI
  3. Right-click the homestead-7 box, and choose Settings
  4. Click 'Network'
  5. Under 'Adapter 1', which should be attached to NAT, click 'Advanced'
  6. Tick the box beside 'Cable Connected'
  7. Save settings, and reprovision Homestead with vagrant up --provision
  8. Run vagrant reload --provision to reprovision the machine
,原帖网址:http://stackoverflow.com/questions/40968297/laravel-homestead-hangs-at-ssh-auth-method-private-key-on-mac/40998978


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Laravel Homestead是一个方便的开发环境,可以帮助你在本地快速搭建一个与生产环境相似的开发环境。而Elasticsearch是一个开源的分布式搜索和分析引擎,可以用于实时搜索、日志分析、数据可视化等场景。 要在Laravel Homestead安装elasticsearch,你可以按照以下步骤进行操作: 1. 首先,确保你已经安装Laravel Homestead。如果还没有安装,请参考Laravel官方文档中的安装指南。 2. 打开Homestead.yaml文件,该文件位于你的Homestead目录下。在该文件中,找到`sites`部分,并添加一个新的站点配置,例如: ``` sites: - map: yoursite.test to: /home/vagrant/Code/your-site/public ``` 3. 保存并关闭Homestead.yaml文件。 4. 运行`vagrant reload --provision`命令来重新加载Homestead配置。 5. 进入Homestead虚拟机,运行`vagrant ssh`命令。 6. 在Homestead虚拟机中,使用以下命令安装elasticsearch: ``` sudo apt-get update sudo apt-get install openjdk-8-jdk wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - sudo apt-get install apt-transport-https echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list sudo apt-get update sudo apt-get install elasticsearch ``` 7. 安装完成后,启动elasticsearch服务: ``` sudo systemctl enable elasticsearch.service sudo systemctl start elasticsearch.service ``` 现在,你已经成功在Laravel Homestead安装了elasticsearch。你可以通过访问`yoursite.test`来验证elasticsearch是否正常工作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值