To setup the permissions to www-data with chown or chmod tmp directory, Add the following to the end of the deploy.rb

after “deploy:finalize_update” do
run “chown -R www-data:www-data #{latest_release}”

run “chmod -R 777 #{latest_release}/tmp”
end

OR

after "deploy:finalize_update" do
  run "sudo chown -R www-data:www-data #{latest_release}/#{cache_path}"
  run "sudo chown -R www-data:www-data #{latest_release}/#{log_path}"
  run "sudo chmod -R 777 #{latest_release}/#{cache_path}"
end
Advertisements