Homestead给出404 Not Found

时间:2014-12-12 16:05:23

标签: laravel vagrant

我正在努力让Homestead 2.0升级并运行,以便与Laravel一起用于本地开发。我跟着Laracast,但我得到404 Not Found。确实

这是我在运行homestead up命令时得到的结果

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: homestead
==> 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 => 8000 (adapter 1)
    default: 443 => 44300 (adapter 1)
    default: 3306 => 33060 (adapter 1)
    default: 5432 => 54320 (adapter 1)
    default: 22 => 2222 (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: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if its present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => /Users/me/.composer/vendor/laravel/homestead
    default: /home/vagrant/Projects => /Users/me/Projects
==> default: Running provisioner: file...
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtfIqsdadasdadaiHuOJAFEM6Fy1hwpnknHbezsl8VHl1CzRRGLWR0a1O0GFCB8bQGgaQlJF4rnncxOMj3e28soXUX/hrSgayY/Qo5ZddadsdadsadsdI2STFk7ZhSg6rjaDXYWwVDVMLqyqv8HBulYx0IEgkH5/Hwlw9UCia0OEkbKpsdasdadaxm5128OJFtykWdKpkhkopkopkopkopsgyDsZ6pRccDaITjNKT0aU2bpwSnRx+oLQ18Y32xFSOhq8VwkEdrOvYy9FPe2YAbbi82J7sValnRY+K2+NooU3/XmSCDb me@Me.local
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: Running provisioner: shell...
    default: Running: inline script
==> default:  * Restarting nginx nginx
==> default:    ...done.
==> default: php5-fpm stop/waiting
==> default: php5-fpm start/running, process 2233
==> default: Running provisioner: shell...
    default: Running: /var/folders/09/bfdxycfd2t1b2ycm3zgmtq100000gn/T/vagrant-shell20141212-2178-1bbctyq.sh
==> default: Warning: Using a password on the command line interface can be insecure.
==> default: Warning: Using a password on the command line interface can be insecure.
==> default: Running provisioner: shell...
    default: Running: /var/folders/09/bfdxycfd2t1b2ycm3zgmtq100000gn/T/vagrant-shell20141212-2178-16noi2s.sh
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: php5-fpm stop/waiting
==> default: php5-fpm start/running, process 2374
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: Updating to version 55895ab494db249bc0fcd836237c3a23c9f36dfc.
==> default:     Downloading: connection...
    Downloading: 0%           
==> default: 
==> default:     Downloading: 5%
==> default: 
==> default:     Downloading: 10%
==> default: 
==> default:     Downloading: 15%
==> default: 
==> default:     Downloading: 20%
    Downloading: 25%
    Downloading: 30%
==> default: 
==> default:     Downloading: 35%
==> default: 
==> default:     Downloading: 40%
    Downloading: 45%
==> default: 
==> default:     Downloading: 50%
==> default: 
==> default:     Downloading: 60%
    Downloading: 65%
==> default: 
==> default:     Downloading: 70%
==> default: 
==> default:     Downloading: 75%
==> default: 
==> default:     Downloading: 80%
==> default: 
==> default:     Downloading: 85%
==> default: 
==> default:     Downloading: 90%
==> default: 
==> default:     Downloading: 95%
==> default: 
==> default:     Downloading: 100%
==> default: Use composer self-update --rollback to return to version b23a3cd36870ff0eefc161a4638d9fcf49d998ba
==> default: Running provisioner: shell...
    default: Running: /var/folders/09/bfdxycfd2t1b2ycm3zgmtq100000gn/T/vagrant-shell20141212-2178-1a1rgym.sh

这是Homestead配置文件

ip: "192.168.10.10"
memory: 2048
cpus: 1

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Projects
      to: /home/vagrant/Projects

sites:
    - map: testproject.app
      to: /home/vagrant/Projects/Laravel/public

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

1 个答案:

答案 0 :(得分:2)

SSH进入宅基地虚拟机并尝试运行以下命令。

serve testproject.app /home/vagrant/Projects/Laravel/public