2

I was wondering how I would be able to run multiple versions of homestead without having VirtualBox crash.

I am currently running a default installation of the laravel homestead, but I need to install another custom one, which is customised to work with several proxies.

Just to be clear: I know how to run multiple sites. That is not the issue. I just want to run a second, custom version of the Laravel Homestead Vagrant box, while still having the possibility to run my normal one.

Details: I'm running Homestead v2.1.7 on Mac

Thanks in advance!

linkerd
  • 45
  • 4
  • 1
    looks like a duplicate of http://stackoverflow.com/questions/31139284/using-vagrant-and-homestead-for-multiple-sites-and-per-project-installation – Frederic Henri Sep 22 '15 at 20:30
  • Thanks! I will definitely check it out later today. Someone just told me that it's also possible to set a hostname in your Homestead.yaml file, just under the provider line. That way, the box should get a different name in Virtualbox. It isn't documented however... Trying it out later today. I will report my findings. – linkerd Sep 23 '15 at 07:00
  • Hi @linkerd, were you able to get multiple version of homestead working? I'd like to have multiple version of homestead as well so I can run the PHP 5 version and the PHP 7 version, but the suggested link above seems to answer how to have multiple sites in one install and I already know how to do that. – mtpultz Oct 06 '15 at 09:07
  • hi @mtpultz. Couldn't work it out. Tried it, but it didn't seem to work. But I have to be honest, I didn't invest too much time in it. I ended up using the default homestead and used an open network without proxies (which is slower, but don't have to do all the configuration that way). If you manage to find a solution, please fill me in. – linkerd Oct 07 '15 at 15:41

1 Answers1

4

I know it's an old question, but the problem is still accurate.

There are some circumstances when you have to run two instances of homestead at the same time. For example when you have app that is works with apache, and one that is freaking out when you enable apache on a server. When you enable it on one website in Vagrant.yaml it will redirect every page that is not using apache to the site that is using it, see example:

- map: presta.shop
  to: /home/vagrant/htdocs/presta-shop
  type: apache
  
- map: my.app
  to: /home/vagrant/htdocs/my-app

In this situation when you will call my.app homestead will redirect you to presta.shop - because this site is using apache (PrestaShop needs to run under apache). See this link: Github NGINX and Apache conflict #555

My my.app will crash with apache enabled, or I just don't want to enable it on this app, or I just need one extra server just for testing or something. You have to follow those steps from install homestead. After the installation of first server you need to:

  • run VirtualBox (or other machine you are using)
  • find and rename added homestead box (homestead), to what ever you wish ie: apache_homestead
  • go to homestead dir (cloned from git)
  • find file: Homestead.yaml
  • in Homestead.yaml add new line after provider with name (this is the name of your renamed box apache_homestead in this case), and ip for let say: 192.168.10.11

in this file you can configure many settings, including name:

ip: "192.168.10.11"
memory: 3072
cpus: 1
provider: virtualbox
name: apache_homestead

After that You may change name of a dir where homestead clone is (default name is homestead). If you rename it to homestead_apache and run vagrant up from this directory you will have completely independent server.

To run "normal" server just follow the instructions from install homestead again and run as many servers as You wish :) Run any just go to it homestead directory and run vagrant up. Remember the limitation of your host machine!

IMPORTANT NOTE! You can have all files for all servers in one dir, but every server has it's own database!!. So before you will move application to another server export and import it's database!

Mhluzi Bhaka
  • 1,364
  • 3
  • 19
  • 42
bumerang
  • 1,776
  • 21
  • 30