Paperclip create folder with incorrect permissions
The rails 3.0 app is on ubuntu server using apache/passenger. The user to deploy the开发者_如何学Python 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.
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.
精彩评论