Skip to content

Instantly share code, notes, and snippets.

@tournasdim
Created June 27, 2014 04:42
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 tournasdim/234edbee3c0292f72447 to your computer and use it in GitHub Desktop.
Save tournasdim/234edbee3c0292f72447 to your computer and use it in GitHub Desktop.
Assign permissions to Apache to specified web-directories (Cache dir)
rm -rf app/cache/*
rm -rf app/logs/*
APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\ -f1`
sudo chmod +a "$APACHEUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment