P
P
pegas2019-09-10 16:20:14
ubuntu
pegas, 2019-09-10 16:20:14

How to set permissions in vagrant through shared folders?

I launched vagrant, put the site with the openCart installation into the shared folder on the host, open it, and the site writes that there are no rights to the directory/files - "Warning: Upload directory needs to be writable for OpenCart to work!"
5d77a236e5a08608344231.png
Here is the vagrant config:

Vagrant.configure("2") do |config|

  config.vm.synced_folder "/Users/artemerbulatov/vagr-2/example2", "/var/www", owner: "root", group: "root"


  config.nfs.map_uid = Process.uid
  config.nfs.map_gid = Process.gid

  config.nfs.map_uid = 501
  config.nfs.map_gid = 20


  config.vm.box = "bento/ubuntu-18.04"
  config.vm.network "forwarded_port", guest: 80, host: 8080
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "4096"
  end
  config.vm.provision "shell", inline: <<-SHELL
    sudo apt-get update
    sudo apt-get install -y nginx
  SHELL
end

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Karasik, 2019-09-10
@1PeGaS

I think that here
owner: "root", group: "root"
you need to use the user under which nginx runs - www-data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question