Last active
January 23, 2016 16:13
-
-
Save m4s0/2ceed7fb071a91e3c311 to your computer and use it in GitHub Desktop.
Symfony 3.* init permissions folders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` | |
FOLDERS="var/cache var/logs var/sessions" | |
sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX $FOLDERS | |
sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX $FOLDERS | |
sudo chown -R `whoami`:`whoami` $FOLDERS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment