Set up Automatic Virtual Hosts with Nginx and Apache

It adds and remove sections. Check the bottom of my post for an example …

There are 2 issues with my solution if you’re using puphpet, which is why it isn’t perfect.

  • You need to set a unique hostname for each Config.yaml
  • You need to turn off the default vhost installation that Puphpet tries to use, as that can cause some conflicts.

Nothing insurmountable and for the limited time we have it’s easier to work around that rather than build our own Vagrant file.

While you’re at it, the vagrant-cachier plugin is also very cool, and I’m pretty certain the vagrant-vbguest has sped things up as well.

Now to find a way to make oh-my-zsh the default inside Vagrant …

Example hosts file.

## vagrant-hostmanager-start id: dbe4914c-9e77-47aa-b259-0e150aa15e70
192.168.43.83   gptq gptq.local.dev
## vagrant-hostmanager-end

## vagrant-hostmanager-start id: d55c4fcc-822d-42d7-a64f-99b71be55a6c
192.168.43.83   october-test october-test.local.dev
## vagrant-hostmanager-end
1 Like