Jump to content

changing the website folder on a cloned VM


ajoo

Recommended Posts

Hi all !

 

I recently learnt a bit of vagrant to set up a VM fast and try out things with it and one of the neat things about vagrant is that it lets me keep my project folder / website folder on the host machine and make changes to it there while I can test out the project from the VM 

 

Next I wanted to try and host another site on the same VM so instead of trying it out on the same VM, I thought it would be better to create a clone of the current state of my VM and try out things there. So I made the clone but now I don't know how to change the association of the project folder to another folder on my host machine. 

 

Earlier I did that using vagrant init in the project/website folder and that was how the machine was initialised and created and the folder association was automatically made. Now here the clone is already there and pointing to the same project/website folder and I want to change this to a new folder and try and host 2 websites from there. 

 

This is the folder in the association in the original VM.        vagrant ---www---myproject

 

It is also the same in the clone. But I would like to somehow change this to say      vagrant1 ----www --- MP1

                                                                                                                                                           | ---- MP2

 

I have searched the net but to no avail. Please looking to the experts for some help here. 

 

Thanks loads !!

Edited by ajoo
Link to comment
Share on other sites

For a simple solution, keep your virtualhost conf files on the host machine (eg, vagrant/www/*.conf) and do something like

Include /path/to/wherever/*.conf
in the Apache configuration. Then you can configure each virtualhost however you want, with whatever root you want.
Link to comment
Share on other sites

Hi requinix, 

 

Thanks for that reply. I will try and understand that and implement it and try it out and revert. 

 

Meanwhile I have been thinking about this :

 

When creating a VM using vagrant, a folder is created and vagrant init is used to initialize that folder. The project folders are the created Inside that folder.  

In case of cloning of VM, the cloned VM does not actually have any folder initialized on the host machine ? Would not that be required first after cloning before creating any project folders?

 

If that is required then how to go about it.

 

Thanks.

Link to comment
Share on other sites

Hi Guru Jacques !

 

No, I don't want to clone a VM for each site. In fact I just want to use one VM for multiple sites hosting. The cloning is to create a VM so as not to disturb anything on the VM where I have hosted one of the projects successfully. 

 

I wanted to learn how to host multiple site on a VM. Hence I cloned a VM from my existing VM state so that I could then test / try out stuff on the cloned VM. Ofocurse the cloned VM does not have any vagrant initialized folder on the host machine and hence my question. 

 

Thank you !

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.