summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-02-25 15:36:15 +0100
committermh <mh@immerda.ch>2011-02-25 15:36:15 +0100
commitc67f0b2119e0e3fb2101f722550d805534c37f91 (patch)
treed64504982393c6d5f917be8e4ac1856583220dcd /templates
parent616fcb124ebe423929b70ca153a858a238a16846 (diff)
fixing template foo
Diffstat (limited to 'templates')
-rw-r--r--templates/vhosts/default.erb5
-rw-r--r--templates/vhosts/partials/header_default.erb25
-rw-r--r--templates/vhosts/partials/logs.erb10
3 files changed, 20 insertions, 20 deletions
diff --git a/templates/vhosts/default.erb b/templates/vhosts/default.erb
index 172518c..22aa391 100644
--- a/templates/vhosts/default.erb
+++ b/templates/vhosts/default.erb
@@ -6,12 +6,13 @@ vhost_parts = case ssl_mode
else [:normal,:ssl]
end
vhost_parts.each do |vhost_part|
- # we need this variable in included templates
- @vhost_part = 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/logs.erb') %>
<%- if ssl_mode == 'force' && vhost_part == :normal %>
diff --git a/templates/vhosts/partials/header_default.erb b/templates/vhosts/partials/header_default.erb
index 7d43bde..f454bdf 100644
--- a/templates/vhosts/partials/header_default.erb
+++ b/templates/vhosts/partials/header_default.erb
@@ -1,13 +1,12 @@
- Include include.d/defaults.inc
- <%- if @vhost_part == :ssl %>
- Include include.d/ssl_defaults.inc
- <%- end %>
-
- ServerName <%= servername %>
- <%- unless serveralias.to_s.empty? then -%>
- ServerAlias <%= serveralias %>
- <%- end -%>
- <%- unless server_admin.to_s.empty? or server_admin.to_s == 'absent' then -%>
- ServerAdmin <%= server_admin %>
- <%- end -%>
- DocumentRoot <%= documentroot %>/
+ Include include.d/defaults.inc
+ <%- if vhost_part == :ssl %>
+ Include include.d/ssl_defaults.inc
+ <%- 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') -%>
+ ServerAdmin <%= server_admin %>
+ <%- end -%>
+ DocumentRoot <%= documentroot %>/
diff --git a/templates/vhosts/partials/logs.erb b/templates/vhosts/partials/logs.erb
index b61018c..9b03426 100644
--- a/templates/vhosts/partials/logs.erb
+++ b/templates/vhosts/partials/logs.erb
@@ -1,14 +1,14 @@
<%- case logmode.to_s
- when 'nologs' -%>
+ when 'nologs' %>
ErrorLog /dev/null
CustomLog /dev/null
- <%- when 'semianonym' -%>
+ <%- when 'semianonym' %>
ErrorLog <%= logdir %>/error_log
CustomLog <%= logdir %>/access_log noip
- <%- when 'anonym' -%>
+ <%- when 'anonym' %>
ErrorLog /dev/null
CustomLog <%= logdir %>/access_log noip
- <%- else -%>
+ <%- else %>
ErrorLog <%= logdir %>/error_log
CustomLog <%= logdir %>/access_log combined
- <%- end -%>
+ <%- end %>