Skip to content

Instantly share code, notes, and snippets.

@shaneog
Created August 30, 2011 16:20
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save shaneog/1181280 to your computer and use it in GitHub Desktop.
Save shaneog/1181280 to your computer and use it in GitHub Desktop.
Capifony Task to Set ACLs on Symfony2 app/cache and app/logs directories as per http://symfony.com/doc/current/book/installation.html
# Change ACL on the app/logs and app/cache directories
after 'deploy', 'deploy:update_acl'
# This is a custom task to set the ACL on the app/logs and app/cache directories
namespace :deploy do
task :update_acl, :roles => :app do
shared_dirs = [
app_path + "/logs",
app_path + "/cache"
]
# add group write permissions
#run "chmod -R g+w #{shared_dirs.join(' ')}"
# Allow directories to be writable by webserver and this user
run "cd #{latest_release} && sudo setfacl -R -m u:www-data:rwx -m u:#{user}:rwx #{shared_dirs.join(' ')}"
run "cd #{latest_release} && sudo setfacl -dR -m u:www-data:rwx -m u:#{user}:rwx #{shared_dirs.join(' ')}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment