Link to home
Start Free TrialLog in
Avatar of Goutham
GouthamFlag for India

asked on

directory and file ownership and permission getting changed in linux

Dear Experts
Sugacrm application which of LAMP stack running on centos 7.8 , the document root is /var/www/html/sugarapp
#chown apache:apache -R sugarapp
#chmod R 2775  sugarapp
Then under sugarapp
  • chown -R www:www *
  • chmod -R 2775 ./cache/
  • chmod -R 2775 ./custom/
  • chmod -R 2775 ./data/
  • chmod -R 2775 //modules/
The developer is given access only though web interface and does their development work, but very frequently developer reports error is thrown to them showing up permission denied for one or the other files  which are under the sugarapp/cache, when I login and check I could see the entire cache directory ownership would have got changed from www (web user) to root and permission only for root would have got set, I have to set the owner to www and provide permission
Please help me with permanent fix for the above issue,
not sure why sub directories and files of document root directory “sugarapp” is not inheriting the ownership and permissions from it (parent directory) to all its sub direcotires and files (existing and newly going to get created) Please help me with correct chown or chmod if above is found to the incorrect so that owner ship and permission remains unchanged and gets applied to under it for any new files/directories
ASKER CERTIFIED SOLUTION
Avatar of ssvl
ssvl
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Goutham

ASKER

Thanks for the inputs, will check this and revert.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No way to really answer your question without far more data, like every step of how files get created/changed, then see the exact system or other ACLs affixed to files.
Avatar of Goutham

ASKER

Sir, thanks for the inputs,
able to execute all the commands under
cd .../sugarapp
but when executed setfacl ( distro is centos hence www) below is the message, 
#setfacl -Rm d:u:www:rwX,u:www:rwX
setfacl -Rm d:u:www:rwX,u:www:rwXUsage: setfacl [-bkndRLP] { -m|-M|-x|-X ... } file ...Try `setfacl --help' for more information.You have new mail in /var/spool/mail/root
Avatar of Goutham

ASKER

sorry please ignore the previous, I have to execute this outside the app like below and this worked, thanks.

# setfacl -Rm d:u:www:rwX,u:www:rwX sugarapp

Perfect!

Glad you got this working!