Rails应用程序需要访问tmp目录 [英] Rails application needs access to a tmp directory

查看:124
本文介绍了Rails应用程序需要访问tmp目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用一个Rails应用程序的fleximage插件。因为它没有进入tmp目录它抛出一个错误消息。当我搭配chmod 777 tmp目录一切工作正常。但是,如果我搭配chmod 666这是行不通的。

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.

什么是文件夹适当的权限,需要由导轨/ apache的访问?如果搭配chmod 777,我会打开一个安全漏洞?不会777就给执行权限?

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?

此外,目前的临时文件夹的所有者是root,这应该改为www数据?为什么它会不管文件夹的所有者是谁?

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?

推荐答案

有关文件夹时,的执行的权限是,你需要能够 CD 到它,它没有任何与执行程序。

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.

所有者更改为www数据更加安全,那么可以使用700的权限 - 即的WWW的数据可以使用此文件夹的含义。 777,WWW的数据也可以用它 - 但这样就可以的每个人的其他人是不是你想要的(如果这是一个应用程序特定的临时文件夹中,不改变所有者 / tmp目录)。

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

这篇关于Rails应用程序需要访问tmp目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆