3

I'm quite new to Ubuntu and Linux in general.

I need to create a my www directory (in /home) and set the permissions/ownership correctly so that any new files and directories created by myself (via terminal etc, username is matt) OR the web server (Nginx in this case) are owned by matt:www-data. I believe I need to do something with setfacl but I'm not sure how to do it correctly.

Thanks in advance.

2 Answers2

1

For setting www, I usually set ownership first, in this case I use your username 'matt' and the directory that I use /var/www/. Make sure that your username is member of www-data group, if not, you can add sudo adduser matt www-data

sudo chown matt:www-data -R /var/www

The second thing, we should set permission

sudo chmod 0755 -R /var/www
sudo chmod g+s /var/www
metamorph
  • 1,693
0

As far as I remember, it was enough to set the read flag on the files you want your web server to be able to display and open.

Phoenix87
  • 606