Skip to content

Instantly share code, notes, and snippets.

@redolivedev
Last active January 25, 2017 20:53
Show Gist options
  • Save redolivedev/709198717d55aa1c3c4f58ebf007a57c to your computer and use it in GitHub Desktop.
Save redolivedev/709198717d55aa1c3c4f58ebf007a57c to your computer and use it in GitHub Desktop.
The fix for ubuntu lamp permissions
# Key:
## {YOUR_USER_NAME} replace with the user you log in to the system as
## {APPLICATION_DIRECTORY} : replace with the project directory name
# Installing bindfs (just the first time)
$ sudo apt-get update
$ sudo apt-get -y install bindfs
# Creating the application mountpoint
$ mkdir -p /home/{YOUR_USER_NAME}/sites/{APPLICATION_DIRECTORY}
$ chown -Rf {YOUR_USER_NAME}:{YOUR_USER_NAME} /home/{YOUR_USER_NAME}/sites
$ chmod -Rf 770 /home/{YOUR_USER_NAME}/sites
$ vim /etc/fstab
# Add the following on a new line
bindfs#/var/www/{APPLICATION_DIRECTORY} /home/{YOUR_USER_NAME}/sites/{APPLICATION_DIRECTORY} fuse force-user={YOUR_USER_NAME},force-group={YOUR_USER_NAME},create-for-user=www-data,create-for-group=www-data,create-with-perms=0770,chgrp-ignore,chown-ignore,chmod-ignore 0 0
$ mount /home/{YOUR_USER_NAME}/sites/{APPLICATION_DIRECTORY}
# SRC: http://blog.netgusto.com/solving-web-file-permissions-problem-once-and-for-all/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment