0

I am trying to install a Magento instance using vagrant. I used the MageVagrant repository found here, then modified it so that the default installtion directory on the vagrant machine points to a folder in the /vagrant folder, which is the shared folder (I did this so that I could edit the Magento files on my local machine and store them in version control), so that on my vagrant machine I have a symlink that looks like the following:

/srv/www/magento.localhost.com -> /vagrant/magento.localhost.com

When I try to run the Magento installer, it is fine until I get to the Configuration step of installation, and then I get the following error message:

Path "/srv/www/magento.localhost.com/public_html/app/etc" must be writable.

Path "/srv/www/magento.localhost.com/public_html/var" must be writable.

Path "/srv/www/magento.localhost.com/public_html/media" must be writable.

even though I have run chmod 777 -R on the directories both on my local machine and on the vagrant box. However, it still thinks it is not writable. How can I make these directories writable for the vagrant server?

Community
  • 1
  • 1
GSto
  • 41,512
  • 37
  • 133
  • 184
  • Similar: http://stackoverflow.com/questions/13169154/cannot-change-permissions-of-folders-within-vagrant-home-folder – Emyl Apr 08 '14 at 07:58

1 Answers1

0

By default it makes the mounted folder owned by the vagrant user and group, so you could make the web server you are using have permissions for that, or the way I do it is to add another shared folder and explicitly set the permissions on that share to how I want. Line in my VagrantFile:

config.vm.synced_folder "../project_folder", "/var/www/", owner: "apache", group: "apache"

this will mount the folder "project_folder" which is one level above my vagrant directory to the location "/var/www" inside the virtual machine with the ownership of apache:apache.

This should work. If you are hosting multiple sites inside the vm I suggest setting this shared folder as the parent of all the sites.

Hourd
  • 21
  • 1