Folder folder creates a folder with incorrect permissions

The rails 3.0 application is located on the ubuntu server using apache / passenger. The user to deploy the application is admin, it is also the user who starts the application (did not select a name, the administrator does not have root privileges). Today I updated the paper clip.

The paperclip plugin is used to download images. It loads images correctly, but the created folder uses a permission that no one can read: drwxr-x --- 4 admin admin

As you can see, there is no right for "others", but it seems that apache is trying to read the file using www-admin.

umask for user admin 022, why does the clip create folders without any permissions for others?

How can i change this?

EDIT: I checked that all passenger and rail processes belong to the administrator.

+5
source share
1 answer

If you are 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 also need to change the user and group:

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 simply chmod the directory manually.

0
source

All Articles