diff options
author | mh <mh@immerda.ch> | 2011-02-25 16:13:50 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2011-02-25 16:13:50 +0100 |
commit | fd87aeefb846f7986d936e07fee453fbb25d4833 (patch) | |
tree | bcd99db28619bb8fda5c0b054ba90043191396b8 /templates | |
parent | ef77991e5f8d3a05df8326fafbbfe346bc848c55 (diff) |
cleanup rendering
Diffstat (limited to 'templates')
-rw-r--r-- | templates/vhosts/default.erb | 18 | ||||
-rw-r--r-- | templates/vhosts/partials/header_default.erb | 14 | ||||
-rw-r--r-- | templates/vhosts/partials/logs.erb | 28 |
3 files changed, 30 insertions, 30 deletions
diff --git a/templates/vhosts/default.erb b/templates/vhosts/default.erb index 22aa391..69af8f0 100644 --- a/templates/vhosts/default.erb +++ b/templates/vhosts/default.erb @@ -1,4 +1,4 @@ -<%- +<% vhost_parts = case ssl_mode when 'only' then [:ssl] when false then [:normal] @@ -8,20 +8,20 @@ end vhost_parts.each do |vhost_part| scope.unsetvar('vhost_part') scope.setvar('vhost_part',vhost_part) -%> +-%> <VirtualHost *:<%= vhost_part == :ssl ? '443' : '80' %> > - <%= scope.function_template('apache/vhosts/partials/header_default.erb') %> +<%= scope.function_template('apache/vhosts/partials/header_default.erb') %> - <%= scope.function_template('apache/vhosts/partials/logs.erb') %> +<%= scope.function_template('apache/vhosts/partials/logs.erb') %> - <%- if ssl_mode == 'force' && vhost_part == :normal %> + <% if ssl_mode == 'force' && vhost_part == :normal -%> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L] - <%- else %> - <%= scope.function_template(template_partial) %> - <%- end %> + <% else -%> +<%= scope.function_template(template_partial) %> + <% end -%> </VirtualHost> -<%- end %> +<% end -%> diff --git a/templates/vhosts/partials/header_default.erb b/templates/vhosts/partials/header_default.erb index 968cfeb..4080ac3 100644 --- a/templates/vhosts/partials/header_default.erb +++ b/templates/vhosts/partials/header_default.erb @@ -1,12 +1,12 @@ Include include.d/defaults.inc - <%- if vhost_part == :ssl %> + <% if vhost_part == :ssl -%> Include include.d/ssl_defaults.inc - <%- end %> + <% end -%> ServerName <%= servername %> - <%- unless serveralias.to_s.empty? || (serveralias.to_s == 'absent') %> - ServerAlias <%= serveralias %> - <%- end %> - <%- unless server_admin.to_s.empty? || (server_admin.to_s == 'absent') %> + <% unless serveralias.to_s.empty? || (serveralias.to_s == 'absent') -%> + ServerAlias <%= serveralias -%> + <% end -%> + <% unless server_admin.to_s.empty? || (server_admin.to_s == 'absent') -%> ServerAdmin <%= server_admin %> - <%- end %> + <% end -%> DocumentRoot <%= documentroot %>/ diff --git a/templates/vhosts/partials/logs.erb b/templates/vhosts/partials/logs.erb index 9b03426..0342c49 100644 --- a/templates/vhosts/partials/logs.erb +++ b/templates/vhosts/partials/logs.erb @@ -1,14 +1,14 @@ - <%- case logmode.to_s - when 'nologs' %> - ErrorLog /dev/null - CustomLog /dev/null - <%- when 'semianonym' %> - ErrorLog <%= logdir %>/error_log - CustomLog <%= logdir %>/access_log noip - <%- when 'anonym' %> - ErrorLog /dev/null - CustomLog <%= logdir %>/access_log noip - <%- else %> - ErrorLog <%= logdir %>/error_log - CustomLog <%= logdir %>/access_log combined - <%- end %> + <% case logmode.to_s + when 'nologs' -%> + ErrorLog /dev/null + CustomLog /dev/null + <% when 'semianonym' -%> + ErrorLog <%= logdir %>/error_log + CustomLog <%= logdir %>/access_log noip + <% when 'anonym' -%> + ErrorLog /dev/null + CustomLog <%= logdir %>/access_log noip + <% else -%> + ErrorLog <%= logdir %>/error_log + CustomLog <%= logdir %>/access_log combined + <% end -%> |