我在去Homestead.app时遇到403 Forbidden但它适用于homestead.app/public
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Desktop
to: /home/vagrant/Desktop
type: "nfs"
sites:
- map: valiant.dev
to: /home/vagrant/Desktop/Laravel
databases:
- homestead
对此有任何帮助将不胜感激,我即将放弃并回到codeigniter。
答案 0 :(得分:0)
将 .homestead 文件夹中的homestead.yaml
文件更新为此
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Desktop/Code
to: /home/vagrant/Code
sites:
- map: valiant.app
to: /home/vagrant/Code/public
databases:
- homestead
folders:
- map: ~/Desktop/Code
to: /home/vagrant/Code
这意味着我们将同步桌面/代码文件夹和 / home / vagrant / Code 文件夹,以便在两个文件夹中更新文件。
sites:
- map: valiant.app
to: /home/vagrant/Code/public
这意味着每当您要点击valiant.app
文件夹时,它都会检查/home/vagrant/Code/public
路径
成功配置上述内容后,请执行vim /etc/hosts
并将以下行添加到文件中
192.168.10.10 valiant.dev
完成上述所有任务后,进入主文件夹的Homestead目录并执行以下操作
vagrant reload --provision
上面的命令将在vagrant机器上创建(如果已经存在)并根据它进行映射。现在做
vagrant up
这应该让你工作。