Sync folders deleted content issue

17 views
Skip to first unread message

Bruno Sastre

unread,
Feb 26, 2017, 7:28:01 PM2/26/17
to Vagrant
Hi everyone

I like yo use one virtual machine, and have al my projects using virtual hosts.
Each time I create a new project, I hace to ssh into the virtual machine, go to /etc/apache2/sites-enabled and create a new site.conf with the <VirtualHost *:80> declaration inside.
To avoid having to login with ssh and all that process, i thought a goog idea would be to add a shared/synced to .../sites-enabled so I can easily create the .conf file from my host computer using my text editor of preference. However, the problem is that Vagrant uses my host machine folder as the model folder, and because it is empty (ini the beginning of the vagrant machine creation) /sites-enabled folder in the vm ends up empty. The problem is, inside /sites-enabled exists the 000-default.conf file which holds important information about apache conf, which I obviously need to keep.

I think the question here would be, how do I tell vagrant to merge the synced folders, instead of making a clone of the host machine folder, so that way I don't lost 000-default.conf file.

Alvaro Miranda Aguilera

unread,
Feb 27, 2017, 6:01:20 AM2/27/17
to vagra...@googlegroups.com
hello

is way easier if you copy the contents to an empty folder, and then share that back.

ie

vagrant ssh -c 'sudo cp -ap /etc/apache2/sites-enabled /vagrant/sites-enabled'

and then mount sites-enabled

Virusvrij. www.avast.com

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/ed452279-ad12-4b0d-bf3d-17c79acd7e62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages