1. to install magento first you have create a new user, and look for the web server group as mentioned below. **1. Find the Primary / web Server group **
normally webserver user can be found with root login in SSH or terminal, to understand users and groups I found these articles helpful. https://www.linode.com/docs/tools-reference/linux-users-and-groups/ and https://www.tecmint.com/manage-users-and-groups-in-linux/
egrep -i '^user|^group' /etc/httpd/conf/httpd.conf
on Centos will show user as "apache"
on on Ubuntu will show user ad "www-data"
however, you can change the user name in httpd.conf file
2. now you have toCreate a new "magento_user"and put "magento_user" in webserver group as a primary group
usermod -g apache magento_user
-g for primary group -G for additional secondary group
check groups
groups magento_user
Logout of ssh/terminal and
login back
restart apache server to take effect.
hope this helps