From 05d6d3761c5527c3d8207c131df1f7d083a5ce26 Mon Sep 17 00:00:00 2001 From: Eric Clemmons Date: Fri, 25 Oct 2013 09:41:52 -0500 Subject: [PATCH] Fixed permissions for uploads Fix #31 --- deployment/lib/server.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deployment/lib/server.rb b/deployment/lib/server.rb index 43875da..1659b65 100644 --- a/deployment/lib/server.rb +++ b/deployment/lib/server.rb @@ -22,7 +22,13 @@ desc "Fix permissions" task :permissions do - run "find #{remote_web} -follow -type d -exec chmod 755 {} \\;" + # Avoid uploading problems if Apache owns directories + run "find #{remote_web} -follow -type d -exec chown :www-data {} \\;" + + # Both deploy & Apache have 1st control of directories + run "find #{remote_web} -follow -type d -exec chmod 775 {} \\;" + + # Files should not be executable, but deploy + Apache still have control run "find #{remote_web} -follow -type f -exec chmod 644 {} \\;" end