diff --git a/deployment/lib/server.rb b/deployment/lib/server.rb index f33a550..e7fdf4b 100644 --- a/deployment/lib/server.rb +++ b/deployment/lib/server.rb @@ -23,13 +23,13 @@ desc "Fix permissions" task :permissions do # Avoid uploading problems if Apache owns directories - run "find #{remote_web} -follow -type d -exec chown :www-data {} \\;" + sudo "find -L #{remote_web} -type d -exec chown :www-data {} \\;" # Both deploy & Apache have 1st control of directories - run "find #{remote_web} -follow -type d -exec chmod 775 {} \\;" + sudo "find -L #{remote_web} -type d -exec chmod 775 {} \\; -exec chmod g+s {} \\;" # Files should not be executable, but deploy + Apache still have control - run "find #{remote_web} -follow -type f -exec chmod 644 {} \\;" + sudo "find -L #{remote_web} -type f -exec chmod 664 {} \\;" end namespace :logs do diff --git a/generator/app/templates/web/wp-config.php b/generator/app/templates/web/wp-config.php index e1f712f..b3a86b7 100644 --- a/generator/app/templates/web/wp-config.php +++ b/generator/app/templates/web/wp-config.php @@ -22,8 +22,8 @@ .replace(/(\/\*\*#@\+(?:.|[\r\n])+?\*\/[\r\n]+)(?:.|[\r\n])+?([\r\n]+\/\*\*#@-\*\/)/m, '$1__GENERATED_SALTS_PLACEHOLDER__$2') .split('__GENERATED_SALTS_PLACEHOLDER__').join(props.salts) - // Limit to 5 post revisions - .replace("/* That's all,", "define('WP_POST_REVISIONS', 5);\n\n/*That's all,") + // Limit to 5 post revisions, and force direct filesystem IO + .replace("/* That's all,", "define('WP_POST_REVISIONS', 5);\n\ndefine('FS_METHOD', 'direct');\n\n/*That's all,") %> if (WP_ENV !== 'www') { Genesis::rewriteUrls(); diff --git a/provisioning/roles/common/tasks/main.yml b/provisioning/roles/common/tasks/main.yml index b07f4bc..c8f7298 100644 --- a/provisioning/roles/common/tasks/main.yml +++ b/provisioning/roles/common/tasks/main.yml @@ -40,6 +40,10 @@ when: has_vagrant.stdout sudo: yes +- name: Add www-data user to deploy + user: name=www-data append=yes groups=deploy + sudo: yes + - name: Calculate PHP memory_limit command: echo "{{ 256 if ansible_memtotal_mb > 2048 else 128 }}" register: calc_php_memory_limit