Janak
Janak

Reputation: 5085

Rails application needs access to a tmp directory

I'm using the fleximage plugin with a rails application. It throws an error message because it doesn't have access to the tmp directory. When I chmod 777 the tmp directory everything works fine. But if I chmod 666 it doesn't work.

What are the proper permissions for folder that needs to be accessed by rails/apache? if chmod 777, am I opening a security hole? wouldn't 777 give execute privileges?

Also, currently the owner of the tmp folder is root, should this be changed to www-data? Why would it matter who the owner of the folder is?

Upvotes: 3

Views: 1986

Answers (1)

Wim
Wim

Reputation: 11252

For a folder, the execute permission is what you need to be able to cd into it, it has nothing to do with executing programs.

Changing the owner to www-data is much safer, then you can use the 700 permission - meaning that only www-data can use this folder. With 777, www-data can also use it -- but so can everyone else which is not what you want (if this is an application-specific tmp folder that is, don't change the owner of /tmp).

Upvotes: 5

Related Questions