Skip to content

Instantly share code, notes, and snippets.

@ubermuda
Created January 8, 2013 21:15
Show Gist options
  • Select an option

  • Save ubermuda/4488007 to your computer and use it in GitHub Desktop.

Select an option

Save ubermuda/4488007 to your computer and use it in GitHub Desktop.
sets permissions on a symfony's cache and logs directories for both your user and the apache/httpd user
#!/bin/bash
function detect_apache_user {
ps axho user,comm | grep -E "apache|httpd" | grep -v root | uniq | awk 'END { print $1 }'
}
APACHE_USER=$( detect_apache_user )
USER=$( whoami )
echo "Allowing apache user '$APACHE_USER' and user '$USER'"
chmod +a "$( detect_apache_user ) allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
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