我一直在試圖讓這個到現在4小時,現在的工作,我很努力。Laravel家園流浪 - 無法看到網站 - 安裝問題
我想讓我的家園工作。我跟着安裝嚮導在這裏: https://laravel.com/docs/5.2/homestead
我有幾個問題:
1)當我通過克隆GitHub庫安裝家園 - 我在安裝和在src
文件夾中獲得src
我的文件夾有這個:src/stubs/Homestead.yaml
。當我跟着指示我跑慶典init.sh在安裝的根內,在其創建的文件夾/.homestead
3個文件after.sh
一個aliases
和Homestead.yml
文件。根據我的理解,我將修改Homestead.yml
以反映我的環境。問題是哪一個?在隱藏.homestead
文件夾中的一個或我安裝Homestead的地方?
2)當我去http://site1.local:8000/
在瀏覽器中,我得到一個網站無法到達的錯誤 - 拒絕連接。當我去http://localhost:8000/
時,我得到'沒有指定輸入文件'。
3.)通過命令行命令宅不被識別爲一個內部或外部的命令 - 它應該是什麼?我讀過類似問題的人應該運行命令homestead up
但它不被識別。
這裏是我的Homestead.yml文件:
---
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
我已經更新了我的hosts文件。我已經嘗試運行vagrant reload --provision
和vagrant destroy
和其他無用的命令。有什麼建議麼?
這裏是運行vagrant reload --provision
==> 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
更新
我SSH方式登錄到虛擬機,我的文件夾結構看起來像的轉儲:Code/first/index.php
我怎麼更新?
我Homestead.yml
文件有不同的目錄結構 - 我認爲這很可能導致我的問題。我該如何解決?
從我的理解.yml文件決定了虛擬機的文件夾結構?這不是這種情況?
你可以粘貼你的主機文件和「vagrant reload --provision」的輸出。你可以製作一個nmap到Vagrant IP「nmap 192.168.10.10」並粘貼輸出嗎? –
@JesúsAmieiro如何製作一個nmap到Vagrant IP? – Radmation
您必須安裝nmap(安裝方法取決於您的主機)https://nmap.org/download.html,然後您必須執行「nmap 192.168.10.10」。該命令將顯示您的Vagrant VM的開放端口。 –