aws / opsworks-cookbooks

Chef Cookbooks for the AWS OpsWorks Service
Other
1.05k stars 1.23k forks source link

apache2 mod_deflate not enabled due to problem with template config file #379

Open bananastalktome opened 8 years ago

bananastalktome commented 8 years ago

In the apache2 deflate.conf.erb module template file, a semicolon at the end of the "AddOutputFilterByType DEFLATE <%= node[:apache][:deflate_types].join(' ') %>;" line seems to prevent the deflate.conf file from being written to /etc/httpd/mods-available to be symlinked to /etc/httpd/mods-enabled. As a result, mod-deflate is not configured on our apache instance. The deflate.load file created in /etc/httpd/mods-available, but no symlink is created for it in /etc/httpd/mods-enabled. Most unexpectedly, the chef log files are silent about this error (no mention of mod_deflate is in the setup logs at all).

I created a custom cookbook overriding this template file (the same contents, but without the semicolon) and things worked properly (the deflate.conf file is created in /etc/httpd/mods-available and symlinked to /etc/httpd/mods-enabled).

I couldn't find any other github issues/stackoverflow questions referencing this problem, and since the deflate.conf.erb template file doesn't seem to have been changed in several years I wasn't sure if it was isolated to specific situations or if it was an unknown but indeed widespread issue.