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.
I have tried various things, but the main problem currently is, that one project works, while all the others are getting a connection timeout, when trying to access their webpage.
These are the steps I've taken to use Homestead
- Installing VirtualBox
- Installing Vagrant
- Adding homestead with
vagrant box add laravel/homestead
- Clonging the repository
git clone https://github.com/laravel/homestead.git Homestead
- Create Homestead.yaml file in the
Homestead
directory with thebash init.sh
script - Create a new project
laravel new projectA
- Require homestead
composer require laravel/homestead
- Generate Vagrantfile
php vendor/bin/homestead make
- Modify the Homestead.yaml to have an IP that ends with 10
- Create another project
laravel new projectB
- Require homestead
composer require laravel/homestead
- Generate Vagrantfile
php vendor/bin/homestead make
- Modify the Homestead.yaml to have an IP that ends with 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
Now, I'm having the problem, that only one of the projects is reachable. It's always the one from where I called vagrant up
. So if I call vagrant up
from Project A I can access http://projecta.app
and http://projectb.app
times out. The same the other way around, sadly.
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.
I don't want to use the global Homestead, because Laravel said, that it is possible to have a per project
installation, so how do I achieve it? Do you need more information?
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.