简体   繁体   中英

Rails Capistrano deployment user

Currently I deploy my Rails 3.1 app with user "root". I know it's bad :) but which user should I use ? Why ? And what permissions should I set on the files so that Apache/Passenger etc. can access them ?

Thanks for your help, I'd like to understand what's happening beyond the surface.

One way of setting the user/permissions for something like what you've described would be to create a new user specifically for your application and change the owner/group of your app's deploy directory and its contents to yourappuser:apache .

The idea is to disallow any kind of operation from everyone except from yourappuser , which should be able to do everything, and apache, which should be able to read its contents.

In order to do this, you can then change the permissions on this folder to allow its owner to read/write/execute and its group to read its contents, while disallowing everything from any other user (740, for instance).

There are many other approaches, but I tend to use this one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM