Skip to content

Instantly share code, notes, and snippets.

@mikebarnhardt
Created January 2, 2018 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikebarnhardt/86366bbf00b8dfef1bd13bf66e60cb0a to your computer and use it in GitHub Desktop.
Save mikebarnhardt/86366bbf00b8dfef1bd13bf66e60cb0a to your computer and use it in GitHub Desktop.
Give www folder to group permissions.

Add your Node user. If Apache or something else this could be www-data.

sudo adduser nodejs

Add users to that group to allow access to the www directory.

sudo usermod -aG nodejs <username>

Change the group of www folder.

sudo chgrp -R nodejs /var/www

Give the group read/write access.

sudo chmod -R g+rw /var/www

Force new files and directories to use the same permissions.

find /var/www -type d -print0 | sudo xargs -0 chmod g+s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment