My /var/www
is this (permissions 755)
drwxr-x--- 3 www-data www-data 4096 gen 11 16:27 www
My /var/www/html
is this (permissions 755)
drwxr-xr-x 2 www-data www-data 4096 gen 11 16:27 html
NOTE: if it's important, I installed php 7.2 and nginx on a Ubuntu 16.04.5; that for say that I manually created
/var/www
and/var/www/html
because not created from nginx's installation
My user is named mirko
And using command group mirko
I can see I am member of www-data
mirko : www-data adm cdrom sudo dip plugdev lxd lpadmin sambashare
But I cannot write files in /var/www/html
. Of course, it because of 755
permissions.
question: the 755 is the suggested permission for /var/www/html
in a lot of tutorials; but in this way, how is supposed I manage file into this folder?
My user must be able to run a composer create-project
for example, and also git pull
and so on.
What's the right settings for shell user and folder?
I know I can simply add +w recusively. My question was: if suggested permissions for
html
folder is755
(or even750
) and suggested ownership iswww-data:www-data
... how can a shell user access html subofolders?
Thanks in advance
www-data
? I can't seewww-data
in your output. try logging out and relogin after adding your self towww-data
:sudo gpasswd -a mirko www-data
– Ravexina Jan 11 '19 at 16:20775
for folders and664
for files.chmod -R g+w /var/www/html
. – pLumo Jan 11 '19 at 16:20g+w
for files thatwww-data
needs write access. You can write the answer best by yourself I guess ;-) – pLumo Jan 11 '19 at 16:37