Laravel Homestead Vagrant - 看不到网站 - 安装问题

时间:2016-08-01 20:06:04

标签: bash laravel vagrant homestead

我一直试图让它现在工作4个小时,我正在努力。

我正试图让我的宅基地工作。我按照安装指南进行操作: https://laravel.com/docs/5.2/homestead

我有几个问题:

1。)当我通过克隆github repo安装宅基地时 - 我在该安装中得到一个src文件夹,在src文件夹中我有:src/stubs/Homestead.yaml。当我按照说明操作时,我在该安装的根目录中运行了bash init.sh,并创建了一个/.homestead文件夹,其中包含3个文件after.sh a aliases和{{1文件。根据我的理解,我要修改Homestead.yml以反映我的环境。问题是哪一个?隐藏的Homestead.yml文件夹中的那个或我安装Homestead的地方的那个?

2。)当我在浏览器中访问.homestead时,我收到一个无法访问的网站错误 - 拒绝连接。当我转到http://site1.local:8000/时,我得到'未指定输入文件。'

3。)命令行中的Homestead命令不被识别为内部或外部命令 - 它应该是什么?我读过有类似问题的人应该运行命令http://localhost:8000/但是我不认识它。

这是我的Homestead.yml文件:

homestead up

这是我的主机文件:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/LaravelProjects/projects
      to: /home/vagrant/Code

sites:
    - map: site1.local
      to: /home/vagrant/Code/Laravel/public

databases:
    - homestead

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp

我更新了我的主机文件。我试过运行# Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost #laravel project 1 192.168.10.10 site1.local vagrant reload --provision以及其他没有运气的流浪命令。有什么建议吗?

以下是运行vagrant destroy

的转储
vagrant reload --provision

更新

我ssh进入VM,我的文件夹结构如下:==> default: Attempting graceful shutdown of VM... ==> default: Checking if box 'laravel/homestead' is up to date... ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat default: Adapter 2: hostonly ==> default: Forwarding ports... default: 80 (guest) => 8000 (host) (adapter 1) default: 443 (guest) => 44300 (host) (adapter 1) default: 3306 (guest) => 33060 (host) (adapter 1) default: 5432 (guest) => 54320 (host) (adapter 1) default: 22 (guest) => 2222 (host) (adapter 1) ==> default: Running 'pre-boot' VM customizations... ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Remote connection disconnect. Retrying... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... default: The guest additions on this VM do not match the installed version of default: VirtualBox! In most cases this is fine, but in rare cases it can default: prevent things such as shared folders from working properly. If you see default: shared folder errors, please make sure the guest additions within the default: virtual machine match the version of VirtualBox you have installed on default: your host and reload your VM. default: default: Guest Additions Version: 5.0.20 default: VirtualBox Version: 5.1 ==> default: Setting hostname... ==> default: Configuring and enabling network interfaces... ==> default: Mounting shared folders... default: /vagrant => C:/Users/Radley.Anaya/LaravelProjects/Homestead default: /home/vagrant/Code => C:/Users/Radley.Anaya/LaravelProjects/projects ==> default: Running provisioner: file... ==> default: Running provisioner: shell... default: Running: inline script ==> default: Running provisioner: shell... default: Running: inline script ==> default: Running provisioner: shell... default: Running: C:/Users/RADLEY~1.ANA/AppData/Local/Temp/vagrant-shell20160801-10000-y9i8nr.sh ==> default: Running provisioner: shell... default: Running: script: Creating Site: site1.local ==> default: Running provisioner: shell... default: Running: script: Restarting Nginx ==> default: Running provisioner: shell... default: Running: script: Creating MySQL Database ==> default: Running provisioner: shell... default: Running: script: Creating Postgres Database ==> default: Running provisioner: shell... default: Running: script: Clear Variables ==> default: Running provisioner: shell... default: Running: inline script ==> default: You are already using composer version 1.2.0 (stable channel). ==> default: Running provisioner: shell... default: Running: C:/Users/RADLEY~1.ANA/AppData/Local/Temp/vagrant-shell20160801-10000-i2qk4o.sh 如何更新它?

我的Code/first/index.php文件有不同的目录结构 - 我认为这可能会导致我的问题。我该如何解决?

根据我的理解,.yml文件决定了虚拟机的文件夹结构?事实并非如此?

1 个答案:

答案 0 :(得分:1)

Solved

My mappings were messed up. I ssh'd into the vm to verify and updated my .yaml file then provisioned the vm and everything is working. Also I had to remove the port from my url.