我一直试图在我当地的Homestead空间设置第二个Laravel 5应用程序。我一直在遵循official documentation和this blog的说明。 (虽然我必须使用该规定的特定ID才能使vagrant provision命令起作用。)
我的YAML文件如下所示:
---
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
我的主机文件如下所示: 127.0.0.1 localhost 192.168.10.10 homestead.app 192.168.10.10 tinkertower.app
我认为已经完成配置和所有爵士乐,这应该是在tinkertower文件夹中设置一个启动Laravel应用程序,并指向tinkertower.app应该工作。但是,tinkertower文件夹是空的,并且尝试访问该站点会给我一个未找到的服务器,"因为它试图找到www.tinkertower.app。我仍然可以访问homestead.app网站。我试过" serve"在进入宅基地的过程中发挥作用,但它没有任何区别。
所以,问题: 1.这些步骤是否应该在tinkertower文件夹中添加干净版Laravel?如果没有,我是否应该从Github获取新版本?
提前致谢!
修改1
更新了YAML文件: --- ip:" 192.168.10.10" 记忆:2048 cpus:1 提供者: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
主机文件: #Copyright(c)1993-2009 Microsoft Corp. # #这是Microsoft TCP / IP for Windows使用的示例HOSTS文件。 # #该文件包含IP地址到主机名的映射。每 #entry应保留在单独的行中。 IP地址应该 #将被放置在第一列中,后跟相应的主机名。 #IP地址和主机名应至少相隔一个 # 空间。 # #此外,可以在个人上插入评论(例如这些) #行或遵循由'#'表示的机器名称。符号。 # # 例如: # #102.54.94.97 rhino.acme.com#source server #38.25.63.10 x.acme.com #x客户端主机
# 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
答案 0 :(得分:0)
问题发生在你的homestead.yaml文件中。
folders:
- map: C:\Users\Lisa\Documents\Homestead\larapipeline
to: /home/vagrant/Code/larapipelin
- map: C:\Users\Lisa\Documents\Homestead\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
不要忘记编辑您的主机文件。现在运行vagrant up --provision
或vagrant reload --provision
。
修正此行的案例敏感度问题。
- map: tinkertower.app
to: /home/vagrant/Code/tinkertower/public
对不起另一个错误:)
您应该将您的网站放在Homestead配置目录所在的目录中。
+ Documents
|
| --- Homestead
|
| --- larapipeline
|
| --- tinkertower
因此,所有三个文件夹larapipeline
,tinkertower
和Homestead
都应位于Documents
目录中。
无论如何最终的代码(希望我没有更多错误):
folders:
- map: C:\Users\Lisa\Documents\larapipeline
to: /home/vagrant/Code/larapipelin
- 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
您的主持人文件:
127.0.0.1 homestead.app
127.0.0.1 tinkertower.app
您遇到区分大小写问题。我修好了,只需将这两行复制并粘贴到正确的位置即可。
- map: tinkertower.app
to: /home/vagrant/Code/tinkertower/public
更改您的主机文件,只需执行此操作并稍后提问。
# 127.0.0.1 localhost you don't need this line
127.0.0.1 tinkertower.app
127.0.0.1 homestead.app
不要忘记将实际文件夹移动到正确的位置