I've been trying to set up a second Laravel 5 app on my local Homestead space. I have been following the instructions from the official documentation and from this blog. (Although I have had to use the specific ID of the provision in order to get the vagrant provision command to work.)
My YAML file looks like this:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: C:\Users\Lisa\Documents\Homestead
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/larapipeline/public
- map: tinkertower.app
to: /home/vagrant/code/tinkertower/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 93000
# to: 9300
# - send: 7777
# to: 777
# protocol: udp
My hosts file looks like this: 127.0.0.1 localhost 192.168.10.10 homestead.app 192.168.10.10 tinkertower.app
I THINK that having gone the provisioning and all that jazz, this should be setting up a starter Laravel app in the tinkertower folder, and that pointing to tinkertower.app should work. The tinkertower folder is empty, however, and trying to visit the site gives me a "server not found," as it's trying to find www.tinkertower.app. I can still get to the homestead.app site. I tried the "serve" command while sshed into homestead, but it didn't make any difference.
So, the questions: 1. Should these steps have added a clean version of Laravel into the tinkertower folder? If not, am I just supposed to grab a new version from Github?
- Am I missing something that should get the tinkertower.app link working? I don't know enough to know if the fact that both sites have the same IP address is a problem nor how to fix it, nor if I'm missing something else. (After all, if I go to the IP address 192.168.10.10 directly, I get to the first app.)
Thanks in advance!
Edit 1
Updated YAML file: --- ip: "192.168.10.10" memory: 2048 cpus: 1 provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: C:\Users\Lisa\Documents\larapipeline
to: /home/vagrant/Code/larapipeline
- map: C:\Users\Lisa\Documents\tinkertower
to: /home/vagrant/Code/tinkertower
sites:
- map: homestead.app
to: /home/vagrant/Code/larapipeline/public
- map: tinkertower.app
to: /home/vagrant/code/tinkertower/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 93000
# to: 9300
# - send: 7777
# to: 777
# protocol: udp
Hosts file: # 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
127.0.0.1 localhost
192.168.10.10 tinkertower.app
192.168.10.10 homestead.app
The problem was in your homestead.yaml file.
Don't forget to edit your hosts file. Now run
vagrant up --provision
, orvagrant reload --provision
.Edit:
Fixed case sensitivity issue on this line.
Edit 2:
Sorry another mistake :)
You should put your websites into the same directory your Homestead config directory is in.
So all three folders,
larapipeline
,tinkertower
, andHomestead
should be inDocuments
directory.Anyways final code here (hopefully no more mistakes by me):
Your hosts file:
Edit 3:
You have a case sensitivity issue. I fixed it, just copy and paste these two lines in the correct place.
Change your hosts file, just do it and ask questions later.
Don't forget to move your actual folders to the correct place