From 5d6a8d82224a63c61d61b3a71703b41809f235d3 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 17 Mar 2011 13:17:10 +0100 Subject: put mod_security stuff in its own partial --- templates/vhosts/default.erb | 21 +++------------------ templates/vhosts/partials/mod_security.erb | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 templates/vhosts/partials/mod_security.erb (limited to 'templates') diff --git a/templates/vhosts/default.erb b/templates/vhosts/default.erb index 41879c8..4acb6b4 100644 --- a/templates/vhosts/default.erb +++ b/templates/vhosts/default.erb @@ -22,26 +22,11 @@ vhost_parts.each do |vhost_part| <% else -%> <%= scope.function_template(template_partial) %> <% end -%> - - <%- if mod_security.to_s == 'true' then -%> - SecRuleEngine On - <%- if mod_security_relevantonly.to_s == 'true' then -%> - SecAuditEngine RelevantOnly - <%- else -%> - SecAuditEngine On - <%- end -%> - <%- else -%> - SecRuleEngine Off - SecAuditEngine Off - <%- end -%> - SecAuditLogType Concurrent - SecAuditLogStorageDir <%= logdir %>/ - SecAuditLog <%= logdir %>/mod_security_audit.log - SecDebugLog <%= logdir %>/mod_security_debug.log - + +<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %> <%- unless additional_options.to_s == 'absent' then -%> <%= additional_options %> <%- end -%> -<% end -%> \ No newline at end of file +<% end -%> diff --git a/templates/vhosts/partials/mod_security.erb b/templates/vhosts/partials/mod_security.erb new file mode 100644 index 0000000..0e0f803 --- /dev/null +++ b/templates/vhosts/partials/mod_security.erb @@ -0,0 +1,17 @@ + + <%- if mod_security.to_s == 'true' then -%> + SecRuleEngine On + <%- if mod_security_relevantonly.to_s == 'true' then -%> + SecAuditEngine RelevantOnly + <%- else -%> + SecAuditEngine On + <%- end -%> + <%- else -%> + SecRuleEngine Off + SecAuditEngine Off + <%- end -%> + SecAuditLogType Concurrent + SecAuditLogStorageDir <%= logdir %>/ + SecAuditLog <%= logdir %>/mod_security_audit.log + SecDebugLog <%= logdir %>/mod_security_debug.log + -- cgit v1.2.3