Vagrant file structure and web root -


i've read docs , few things still confuse me, related sync folders , database data.

i want use following folder structure on host machine

root
|- workfolder
||- project1
|||- project1databaseandfiles
|||- project1webroot
||- project2
|||- project2databaseandfiles
|||- project2webroot
||- project3
|||- project3databaseandfiles
|||- project3webroot

and create vm's each vm host webroot points appropriate projectx/projectxwebroot folder.
i've read, can specify 1 remote sync dir. (http://docs.vagrantup.com/v2/synced-folders/). if create new vm want specify project name too, thereby selecting correct host folder.

is i'm describing possible using vagrant?
if wanted developer use environment, i'd them have instant access database structure/setup etc without having import sql files. possible?

i'm hoping i'm not understanding vagrants purpose, seems use of shared vm's me. pointers or articles might welcome.

from i've read, can specify 1 remote sync dir.

no not true. can add more shared folders. manual:

this directive used configure shared folders on virtual machine , may used multiple times in vagrantfile.

this means can define additional shared folders using:

  config.vm.share_folder "name", "/path/on/vm", "path/on/host" 

if wanted developer use environment, i'd them have instant access database structure/setup etc without having import sql files. possible?

yes, can alter data storage path of, say, mysql store in on share on host data not lost when vm destroyed.

however, not simple sounds. if you're using mysql cookbook (again, assuming you're using mysql), have modify shared folder mounted uid , gid of mysql user or otherwise user can't write it. can mount share manually this:

mount -t vboxsf -o uid=`id -u mysql` -o gid=`id -g mysql` sharename /new/data/dir 

also, if you're using ubuntu or debian wheezy, apparmor needs configured differently mysql, not allow writes newly configured data directory. can done writing

/new/data/dir r, /new/data/dir/** rwk, 

to /etc/apparmor/apparmor.d/local/usr.sbin.mysqld. this version of mysql cookbook supports behaviour already, can how that.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -