unable to set constant permissions for web files

by Harley Frank   Last Updated January 14, 2018 00:02 AM

I have set up 4 websites inside the /var/www/html/ folder.

  • hbf-server
  • hbf
  • tf
  • 2e

Now the permissions are root:www-data with 755 and supposed to be recursive. However, when uploading data from my account harleyfrank it just sets permissions for me and I get an apache error because of the permissions.

I followed these websites:

But the weird thing is that it is appling harleyfrank:www-data with read write permissions only to harleyfrank. I am not sure how to get it fixed.



Answers 1


To fix it use the setfacl comamnd to set the permissions and default owners:

sudo setfacl -d -R -m u:root:rwx,g:www-data:rw,o::r /var/www/html

Info:

  • -d: set as default so new folders will inherit it automatically
  • -R: recursive
  • -m: modify existing permissions and ownerships
  • u:root:rwX: give user root rwx on the folders and files
  • g:www-data:rw: give user www-data rw on the folders
  • o::r: give others read rights on folders
George Udosen
George Udosen
January 13, 2018 23:45 PM

Related Questions


VestaCP GarrysMod Fastdl page access

Updated April 12, 2015 23:00 PM



Apache2 Localhost Forbidden 403

Updated July 10, 2015 16:01 PM