views:

284

answers:

1

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?

+4  A: 

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).

Wim
+1 for you last comment "don't change the owner of /tmp", which is very important!
Veger