What is required to map local directory to pseudo URL using Vagrant?

367 Views Asked by At

I'm on a mac, and have Virtual Box and Vagrant set up properly, using the avenuefactory/lamp box. I'm new to Vagrant, so I'm trying to see what is required to map local.example.com to a code base located at ~/code/example/public on my host machine. I've tried using the config.vm.network in my Vagrantfile to point to a specific IP, but not sure how to edit Vagrant's equivalent of a vhosts file.

Again, I'm new to this so any help is greatly appreciated!

1

There are 1 best solutions below

1
On BEST ANSWER

Your question is hard to understand Do you try to access to your code from virtual host? In this case Looks like you have to do following:

config.vm.syncedfolder "~/code/example/public", "/var/www/html"

if you need to have access to your virtual host by name, then you need to add to /etc/hosts in host mashine something like:

192.168.10.10 local.example.com