5

The rails 3.0 app is on ubuntu server using apache/passenger. The user to deploy the app is admin, it is also the user running the app (did not choose the name, admin has no root privileges). I updated paperclip again today.

The paperclip plugin is used to upload images. It upload correctly the images but the folder it creates are using permission that no one can read : drwxr-x--- 4 admin admin

As you can see there is no right for "others" but it seems apache try to read the file with www-admin.

The umask for admin user is 022, why does paperclip creates folders with no permissions for others?

How can i change that?

EDIT : I checked, passenger and rails process are all owned by admin.

Syl
  • 3,719
  • 6
  • 35
  • 59

1 Answers1

0

If you're deploying with capistrano add this:

task :chmod_entire_deploy_dir do
 sudo "#{sudo} chmod 0775 -R #{deploy_to}"
end
after "deploy:setup", :chmod_entire_deploy_dir

I have to change the user & group some times too:

task :chown_entire_deploy_dir do
 sudo "#{sudo} chown my_user:my_group -R #{deploy_to}"
end
after "deploy:setup", :chown_entire_deploy_dir

Otherwise you can just chmod the directory manually.

TomDunning
  • 4,829
  • 1
  • 26
  • 33