Skip to content

Instantly share code, notes, and snippets.

@proudlygeek
Forked from shaneog/update_acl.rb
Created March 12, 2012 09:21
Show Gist options
  • Save proudlygeek/2020876 to your computer and use it in GitHub Desktop.
Save proudlygeek/2020876 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
@liuggio
Copy link

liuggio commented Aug 30, 2012

ops but this need sudo!! grrrr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment