Change the project root directory

Asked

Viewed 169 times

0

I have the following file Vagranfile:

# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.box = "ubuntu/trusty64"

    # Forward ports to Apache and MySQL
    config.vm.network "forwarded_port", guest: 80, host: 8080
    config.vm.network "forwarded_port", guest: 3306, host: 8889

    config.vm.provision "shell", path: "provision.sh"
end

However the directory where I need to have the files PHP is vagrant/src, but I want to change to /home/filipe/projects/havas/src/.

Considering an installation of Vagrant 2.0.1, it is possible to change the project root directory?

1 answer

0

Tries to change the folder synchronization, using the property synced_folder as an example to follow:

config.vm.synced_folder "src/", "/srv/website"

Documentation

  • 1

    Thank you. I did that, but it didn’t work. The first parameter is the host directory and the second parameter is the guest directory. So I hacked into the virtual machine via ssh and edited the DocumentRoot Virtualhost, which was not being updated (shouldn’t this be automatic?) at the time the command was being updated vagrant up was executed. I restarted the Apache service and everything worked. I just don’t understand why it was necessary to edit the DocumentRoot manually.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.