Centos + Apache: can I change owner from "root" to "nobody" safely?
Apache is the default user on Centos, assuming you installed from Yum. You can and should verify by looking in /etc/httpd/conf/httpd.conf.
Are there other things going on with this Magento installation? Such as php suexec? php-fpm or php-cgi process?
Also, the correct command would be
sudo chown -R nobody.devs /path/to/magento
To answer 1 and 2: Running roughshot over the permissions of a running Magento install will give you grief. This might be a great day to clone the box, test, then run in production. "Nobody" user on Centos/Redhat has various web server quirks and too few permissions (think Selinux and all) that the default user is a named user, Apache.
Related videos on Youtube
SPRBRN
Updated on September 18, 2022Comments
-
SPRBRN over 1 year
We have a magento installation on our Centos webserver. The ownership of the files is a bit of a mess. I've had rights issues before, and now magento is complaining that it hasn't enough rights to install a plugin.
I've heard that user "nobody" is the default Apache user. Most of the files and folders have
root:devs
, and I want to change it tonobody:devs
like this:sudo chown -R nobody /path/to/magento
1) This change is site-wide, and I don't want to mess too much with the production installation. Will this have any effect on the site? It works now, except for this plugin installation issue.
It seems to be that apache can use the files no matter who the owners are. I see "root:root", but also files with "john:john" (or similar), "root:devs" (devs being a group of specific users), "john:devs" and "john:users" etc.
2) If I set the owner to "nobody", will magento have enough rights to install that plugin?
-
SPRBRN over 10 yearsThanks! I just remembered that we don't use the standard httpd installation. We use a zend server with apache2. Looking in the httpd.conf file I see that both user and group are in fact "nobody".
-
SPRBRN over 10 yearsI solved my problems via another way. After changing the rights of all folders to 777 I could install the extension. Once installed I could set the rights back. See blog.chapagain.com.np/…