What is the difference on CentOS Linux if you chown apache:root or root:apache?I am trying to set correct ownership for Drupal install but both Drupal Docs and all subsequent pages of discussions following have varying ideas on the subject and without a good base understanding of what it is all about you wouldn't have a clue. Until I find the right documentation on the subject I just want to know the difference of order between root:apache and apache:root if any?
what is the difference in ownership order?
chown
The first argument of ARG1:ARG2 is the Unix owner (user) the second argument is a group. These typically come from the files /etc/passwd (users) and /etc/groups (groups).So in your 1st example you're setting the owner to be the user apache and the group root. In your 2nd example you're setting the owner to be the user root and the group apache.You can use the following commands to see what users and groups are available on your system.ExamplesFirst 10 users on my Fedora 19 system.$ getent passwd | head -10root:x:0:0:root:/root:/bin/bashbin:x:1:1:bin:/bin:/sbin/nologindaemon:x:2:2:daemon:/sbin:/sbin/nologinadm:x:3:4:adm:/var/adm:/sbin/nologinlp:x:4:7:lp:/var/spool/lpd:/sbin/nologinsync:x:5:0:sync:/sbin:/bin/syncshutdown:x:6:0:shutdown:/sbin:/sbin/shutdownhalt:x:7:0:halt:/sbin:/sbin/haltmail:x:8:12:mail:/var/spool/mail:/sbin/nologinoperator:x:11:0:operator:/root:/sbin/nologinFirst 10 groups.$ getent group | head -10root:x:0:bin:x:1:daemon:x:2:sys:x:3:adm:x:4:tty:x:5:disk:x:6:lp:x:7:mem:x:8:kmem:x:9:The owner and the group that you're setting correspond to the permissions on the files and directories on the system.Example$ ls -ld /var/www/htmldrwxr-xr-x. 2 root root 4096 Jul 10 03:47 /var/www/htmlThe above directory has permissions read/write/execute enabled for user root, and read/execute permissions enabled for group root.