summaryrefslogtreecommitdiff
path: root/templates/vhosts/php
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-05-18 00:13:25 +0200
committermh <mh@immerda.ch>2011-05-18 00:13:25 +0200
commit58847f6375cffe9c1018a7b51d5062b86796a534 (patch)
tree95d17096061cf4ca72eac1494cfdb6b4e3204f23 /templates/vhosts/php
parent29517a83414f478a0e28a9fc57b178e35e9ba112 (diff)
move header to partials
Diffstat (limited to 'templates/vhosts/php')
-rw-r--r--templates/vhosts/php/php.erb72
1 files changed, 10 insertions, 62 deletions
diff --git a/templates/vhosts/php/php.erb b/templates/vhosts/php/php.erb
index 851bd52..c0e715c 100644
--- a/templates/vhosts/php/php.erb
+++ b/templates/vhosts/php/php.erb
@@ -4,16 +4,7 @@
<%- end -%>
<%- unless ssl_mode.to_s == 'only' then -%>
<VirtualHost *:80>
- Include include.d/defaults.inc
-
- 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 %>/
+<%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
@@ -29,10 +20,6 @@
</IfModule>
<%- end -%>
- <%- if default_charset.to_s != 'absent' then -%>
- AddDefaultCharset <%= default_charset %>
-
- <%- end -%>
<%- if not ssl_mode.to_s == 'force' then -%>
<Directory "<%= documentroot %>/">
AllowOverride <%= allow_override %>
@@ -69,17 +56,10 @@
<%- unless ssl_mode.to_s == 'false' then -%>
<VirtualHost *:443>
- Include include.d/defaults.inc
- Include include.d/ssl_defaults.inc
-
- 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 %>/
+<% scope.unsetvar('vhost_part')
+ scope.setvar('vhost_part',:ssl) -%>
+ <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
+<% scope.unsetvar('vhost_part') -%>
<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
@@ -89,10 +69,6 @@
</IfModule>
<%- end -%>
- <%- if default_charset.to_s != 'absent' then -%>
- AddDefaultCharset <%= default_charset %>
-
- <%- end -%>
<Directory "<%= documentroot %>/">
AllowOverride <%= allow_override %>
<%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
@@ -129,19 +105,8 @@
<IfDefine !HttpdLocal>
<%- unless ssl_mode.to_s == 'only' then -%>
<VirtualHost *:80>
- Include include.d/defaults.inc
-
- 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 -%>
- <%- if run_mode.to_s == 'static-itk' -%>
- DocumentRoot <%= documentroot %>/
+<%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
DirectoryIndex index.htm index.html index.php
- <%- end -%>
<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
@@ -160,10 +125,6 @@
RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
<%- end -%>
- <%- if default_charset.to_s != 'absent' then -%>
- AddDefaultCharset <%= default_charset %>
-
- <%- end -%>
<%- if run_mode.to_s == 'static-itk' then -%>
<%- if not ssl_mode.to_s == 'force' then -%>
<Directory "<%= documentroot %>/">
@@ -187,20 +148,11 @@
<%- unless ssl_mode.to_s == 'false' then -%>
<VirtualHost *:443>
- Include include.d/defaults.inc
- Include include.d/ssl_defaults.inc
-
- 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 -%>
- <%- if run_mode.to_s == 'static-itk' -%>
- DocumentRoot <%= documentroot %>/
+<% scope.unsetvar('vhost_part')
+ scope.setvar('vhost_part',:ssl) -%>
+ <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
+<% scope.unsetvar('vhost_part') -%>
DirectoryIndex index.htm index.html index.php
- <%- end -%>
<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
@@ -214,10 +166,6 @@
<%- end -%>
ProxyPassReverse / https://127.0.0.1/
- <%- if default_charset.to_s != 'absent' then -%>
- AddDefaultCharset <%= default_charset %>
-
- <%- end -%>
<%- if run_mode.to_s == 'static-itk' -%>
<Directory "<%= documentroot %>/">
AllowOverride <%= allow_override %>