I have been using XAMPP for quite a time, and after discovering Laravel and finding out, that I quite like it, I also wanted to use Homestead. The problem I'm having is, that I can't seem to be able to run multiple sites.
我try 过各种方法,但目前的主要问题是,当试图访问他们的网页时,一个项目可以工作,而所有其他项目都会获得连接超时.
以下是我使用Homestead所采取的步骤
- Installing VirtualBox
- Installing Vagrant
- Adding homestead with
vagrant box add laravel/homestead
- 关闭存储库
git clone https://github.com/laravel/homestead.git Homestead
- 创建家园.使用
bash init.sh
脚本在Homestead
目录中创建yaml文件 - Create a new project
laravel new projectA
- 需要宅地
composer require laravel/homestead
- 生成文件
php vendor/bin/homestead make
- Modify the Homestead.yaml to have an IP that ends with 10
- 创建另一个项目
laravel new projectB
- 需要宅地
composer require laravel/homestead
- 生成文件
php vendor/bin/homestead make
- 修改Homestead.yaml,使其IP以11结尾
- Adding those two sites to the hosts file
sudo nano /etc/hosts
=>xxx.xx.xx.10 projecta.app
&xxx.xx.xx.11 projectb.app
- Starting vagrant from one of the two directories
vagrant up
现在,我的问题是,只有一个项目是可访问的.总是我打vagrant up
的那个.所以,如果我从项目A打vagrant up
,我可以访问http://projecta.app
和http://projectb.app
次.不幸的是,反过来也是如此.
This is my vagrant global-status
id name provider state directory
------------------------------------------------------------------------
fc6fadb default virtualbox running /Users/mknb/work/projectA
I thought I would just do another vagrant up
from the projectB
directory but that doesn't work of course.
我不想使用global Homestead,因为拉维尔说,安装per project
台是可能的,那么我该如何实现呢?你需要更多信息吗?
I didn't modify the Homestead.yaml
except of the IP and the domainname homestead.app
=> projecta.app
It seems like a global installation is fairly easy with Homestead, since I would just have to add more sites to the Homestead.yaml, but as I said I'd like to have a per project installation. Can anybody help?
Starting vagrant from the Homestead directory doesn't work of course.