我正在尝试使用Vagrant 2.1.2和Virtualbox 5.2.18运行Laravel Homestead VM 6.3.0盒的库存安装。我的主机是运行10.13.6的MBP。
这是Laravel Homestead开发环境的标准安装。我能够成功配置,引导并运行该框几分钟,在其中充当开发服务器,并且几分钟之内我就可以通过http毫无问题地与它联系。但是,最终,无论我做什么,该框都开始不通过curl
,Web浏览器或http请求代理返回任何响应-它只是超时。我仍然可以随时ssh
进入访客,并验证我的应用程序和nginx是否正常运行,但是nginx不会显示任何错误或访问日志,就好像它甚至没有收到请求一样。同样,我仍然可以通过端口33060访问来宾计算机上的数据库。
使HTTP访问再次正常工作的唯一方法是丢弃访客并重新开始,在此过程中重复进行。以下附件是我的Vagrantfile以及Homestead文件:
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'json'
require 'yaml'
VAGRANTFILE_API_VERSION ||= "2"
confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__))
homesteadYamlPath = File.expand_path("Homestead.yaml", File.dirname(__FILE__))
homesteadJsonPath = File.expand_path("Homestead.json", File.dirname(__FILE__))
afterScriptPath = "after.sh"
aliasesPath = "aliases"
require File.expand_path(confDir + '/scripts/homestead.rb')
Vagrant.require_version '>= 1.9.0'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if File.exist? aliasesPath then
config.vm.provision "file", source: aliasesPath, destination: "/tmp/bash_aliases"
config.vm.provision "shell" do |s|
s.inline = "awk '{ sub(\"\r$\", \"\"); print }' /tmp/bash_aliases > /home/vagrant/.bash_aliases"
end
end
if File.exist? homesteadYamlPath then
settings = YAML::load(File.read(homesteadYamlPath))
elsif File.exist? homesteadJsonPath then
settings = JSON.parse(File.read(homesteadJsonPath))
else
abort "Homestead settings file not found in #{confDir}"
end
Homestead.configure(config, settings)
if File.exist? afterScriptPath then
config.vm.provision "shell", path: afterScriptPath, privileged: false, keep_color: true
end
if defined? VagrantPlugins::HostsUpdater
config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] }
end
end
ip: "192.168.2.10"
memory: 4096
cpus: 1
name: app
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
-
map: ~/Documents/repos/app
to: /home/app/code
sites:
-
map: myapp.app
to: /home/vagrant/code/laravel/public
databases:
- myapp
可能是什么原因造成的?