1
我玩弄捆绑,注意到一个警告以root权限运行bundle install
时:为什么我不应该以root身份运行bundle install?
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
这是为什么?
为什么这些脚本应该可以被其他用户访问?当我们希望这些只能被运行Apache和Passenger的root用户访问。 – xs2rashid
那么,理想情况下,你不应该以root身份运行Passenger。您的Web服务器应该作为非外壳用户运行,它只对您实际打算发布的目录拥有文件权限。这样,如果恶意/愚蠢的用户试图上传或执行会损害环境的代码,文件系统本身会强制执行安全措施。 – mwobey