user-a run the command
php magento setup:di:compile, it generated cache file with wrong user group, the wrong user group is
user-a(the primary group of user-a), in fact it should be
apache(the apache group in CentOS), then it will result file permission error when visit website in browser.
I had set the
SetGID, most files generated with right user group(apache), only the files in
var/cache/mage-tags folder has wrong user group(user-a), so I have to set its group manually every time, anyone has better way to solve the problem? Thanks.
var/cache/*folders lose their set-gid bits, and
var/cache/mage-tags/*folders are created with magento_user's primary group and 660 permissions, and the web user (www-data) fails opening the site because it cannot access this content.