summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-10-08 19:22:40 +0200
committermh <mh@immerda.ch>2011-10-08 19:22:40 +0200
commit2fa748dcc92e34b13bd4b6f7e452ef89b29490c4 (patch)
treef3827bd2c8cc3206b4f2a5a8a09b4951940d6cc4 /templates
parent24c047d1cfc54c003eef7445e177e28f373c1da4 (diff)
introduce a new template style, less duplicated things, more handy options
Diffstat (limited to 'templates')
-rw-r--r--templates/vhosts/default.erb19
-rw-r--r--templates/vhosts/itk_plus.erb10
-rw-r--r--templates/vhosts/itk_plus/partial.erb32
-rw-r--r--templates/vhosts/partials/php_settings.erb18
-rw-r--r--templates/vhosts/partials/std_override_options.erb4
-rw-r--r--templates/vhosts/perl/partial.erb15
-rw-r--r--templates/vhosts/perl/perl.erb208
l---------templates/vhosts/php/CentOS.erb1
l---------templates/vhosts/php/Debian.erb1
-rw-r--r--templates/vhosts/php/partial.erb7
-rw-r--r--templates/vhosts/php/php.erb195
-rw-r--r--templates/vhosts/php_drupal/partial.erb26
-rw-r--r--templates/vhosts/php_drupal/php_drupal.erb275
l---------templates/vhosts/php_gallery2/CentOS.erb1
l---------templates/vhosts/php_gallery2/Debian.erb1
-rw-r--r--templates/vhosts/php_gallery2/partial.erb16
-rw-r--r--templates/vhosts/php_gallery2/php_gallery2.erb215
l---------templates/vhosts/php_joomla/CentOS.erb1
l---------templates/vhosts/php_joomla/Debian.erb1
-rw-r--r--templates/vhosts/php_joomla/php_joomla.erb205
l---------templates/vhosts/php_mediawiki/CentOS.erb1
l---------templates/vhosts/php_mediawiki/Debian.erb1
-rw-r--r--templates/vhosts/php_mediawiki/php_mediawiki.erb185
-rw-r--r--templates/vhosts/php_silverstripe/partial.erb16
-rw-r--r--templates/vhosts/php_silverstripe/php_silverstripe.erb268
l---------templates/vhosts/php_simplemachine/CentOS.erb1
l---------templates/vhosts/php_simplemachine/Debian.erb1
-rw-r--r--templates/vhosts/php_simplemachine/php_simplemachine.erb182
l---------templates/vhosts/php_spip/CentOS.erb1
l---------templates/vhosts/php_spip/Debian.erb1
-rw-r--r--templates/vhosts/php_spip/php_spip.erb194
-rw-r--r--templates/vhosts/php_typo3/partial.erb10
-rw-r--r--templates/vhosts/php_typo3/php_typo3.erb209
l---------templates/vhosts/php_wordpress/CentOS.erb1
l---------templates/vhosts/php_wordpress/Debian.erb1
-rw-r--r--templates/vhosts/php_wordpress/php_wordpress.erb189
-rw-r--r--templates/vhosts/static/partial.erb5
-rw-r--r--templates/vhosts/webdav/partial.erb21
-rw-r--r--templates/vhosts/webdav/webdav.erb161
39 files changed, 188 insertions, 2511 deletions
diff --git a/templates/vhosts/default.erb b/templates/vhosts/default.erb
index 4acb6b4..5ab1d26 100644
--- a/templates/vhosts/default.erb
+++ b/templates/vhosts/default.erb
@@ -1,8 +1,7 @@
<%
vhost_parts = case ssl_mode
when 'only' then [:ssl]
- when false then [:normal]
- when 'false' then [:normal]
+ when false,'false' then [:normal]
else [:normal,:ssl]
end
vhost_parts.each do |vhost_part|
@@ -15,6 +14,12 @@ vhost_parts.each do |vhost_part|
<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
+ <% if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
+ <IfModule mpm_itk_module>
+ AssignUserId <%= run_uid+" "+run_gid %>
+ </IfModule>
+
+ <% end -%>
<% if ssl_mode == 'force' && vhost_part == :normal -%>
RewriteEngine On
RewriteCond %{HTTPS} !=on
@@ -22,11 +27,11 @@ vhost_parts.each do |vhost_part|
<% else -%>
<%= scope.function_template(template_partial) %>
<% end -%>
-
+<%- unless template_partial == 'apache/vhosts/itk_plus/partial.erb' -%>
<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
+<% end -%>
+<% unless additional_options.to_s == 'absent' -%>
<%= additional_options %>
- <%- end -%>
-</VirtualHost>
<% end -%>
+</VirtualHost>
+<% end -%> \ No newline at end of file
diff --git a/templates/vhosts/itk_plus.erb b/templates/vhosts/itk_plus.erb
new file mode 100644
index 0000000..2890ecf
--- /dev/null
+++ b/templates/vhosts/itk_plus.erb
@@ -0,0 +1,10 @@
+<IfDefine HttpdLocal>
+<%= scope.function_template('apache/vhost/default.erb') %>
+</IfDefine>
+<IfDefine !HttpdLocal>
+<%
+ scope.unsetvar('template_partial')
+ scope.setvar('template_partial','apache/vhosts/itk_plus/partial.erb')
+-%>
+<%= scope.function_template('apache/vhost/default.erb') %>
+</IfDefine> \ No newline at end of file
diff --git a/templates/vhosts/itk_plus/partial.erb b/templates/vhosts/itk_plus/partial.erb
new file mode 100644
index 0000000..e37e418
--- /dev/null
+++ b/templates/vhosts/itk_plus/partial.erb
@@ -0,0 +1,32 @@
+
+ ProxyPreserveHost On
+ ProxyRequests off
+<% if vhost_part == :ssl -%>
+ SSLProxyEngine On
+ <%- if run_mode.to_s == 'static-itk' -%>
+ ProxyPassMatch ^/(.*\.<%= passing_extension %>/?.*)$ https://127.0.0.1/$1
+ <%- else -%>
+ ProxyPass / https://127.0.0.1/
+ <%- end -%>
+ ProxyPassReverse / https://127.0.0.1/
+<% else -%>
+ <% if run_mode.to_s == 'static-itk' -%>
+ ProxyPassMatch ^/(.*\.<%= passing_extension %>/?.*)$ http://127.0.0.1/$1
+ <% else -%>
+ ProxyPass / http://127.0.0.1/
+ <% end -%>
+ ProxyPassReverse / http://127.0.0.1/
+<% end %>
+
+ <% if run_mode.to_s == 'static-itk' && (ssl_mode.to_s != 'force' || vhost_part == :ssl) -%>
+ <Directory "<%= documentroot %>/">
+ AllowOverride <%= allow_override %>
+ <% if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
+ Options <% unless options.to_s == 'absent' then -%><%= options %><% end -%><% if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<% end -%>
+
+ <% end -%>
+<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
+ </Directory>
+ <% end -%>
+
+
diff --git a/templates/vhosts/partials/php_settings.erb b/templates/vhosts/partials/php_settings.erb
index be4662a..8d4fec4 100644
--- a/templates/vhosts/partials/php_settings.erb
+++ b/templates/vhosts/partials/php_settings.erb
@@ -1,7 +1,17 @@
-<% php_settings.each do |key,value| -%>
-<% if ['on','off' ].include?(value.downcase) -%>
- php_admin_flag <%= key %> <%= value %>
+<% php_settings.each do |key,value|
+ dvalue = value.to_s.downcase
+ munged_value = if dvalue == 'true'
+ 'on'
+ elsif dvalue == 'false'
+ 'off'
+ elsif ['on','off'].include?(dvalue)
+ dvalue
+ else
+ value
+ end
+ if ['on','off' ].include?(munged_value) -%>
+ php_admin_flag <%= key %> <%= munged_value %>
<% else -%>
- php_admin_value <%= key %> <%= value %>
+ php_admin_value <%= key %> <%= munged_value %>
<% end -%>
<% end -%> \ No newline at end of file
diff --git a/templates/vhosts/partials/std_override_options.erb b/templates/vhosts/partials/std_override_options.erb
new file mode 100644
index 0000000..d43b042
--- /dev/null
+++ b/templates/vhosts/partials/std_override_options.erb
@@ -0,0 +1,4 @@
+ AllowOverride <%= allow_override %>
+ <% if options.to_s != 'absent' || do_includes.to_s == 'true' -%>
+ Options <%- unless options.to_s == 'absent' then -%><%= options %><% end -%><% if do_includes.to_s == 'true' && !options.include?('+Includes') -%> +Includes<% end -%>
+ <% end -%> \ No newline at end of file
diff --git a/templates/vhosts/perl/partial.erb b/templates/vhosts/perl/partial.erb
new file mode 100644
index 0000000..f75bf3f
--- /dev/null
+++ b/templates/vhosts/perl/partial.erb
@@ -0,0 +1,15 @@
+ <Directory "<%= documentroot %>/">
+<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %>
+
+<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
+ </Directory>
+
+ <% unless htpasswd_file.to_s == 'absent' -%>
+ <Directory "<%= cgi_binpath %>/">
+ AuthType Basic
+ AuthName "Access fuer <%= servername %>"
+ AuthUserFile <%= real_htpasswd_path %>
+ require valid-user
+ </Directory>
+ <% end -%>
+ ScriptAlias /cgi-bin/ <%= cgi_binpath %>/ \ No newline at end of file
diff --git a/templates/vhosts/perl/perl.erb b/templates/vhosts/perl/perl.erb
deleted file mode 100644
index e66981a..0000000
--- a/templates/vhosts/perl/perl.erb
+++ /dev/null
@@ -1,208 +0,0 @@
-# <%= servername %>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<IfDefine HttpdLocal>
-<%- end -%>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
-
- <%- unless htpasswd_file.to_s == 'absent' then -%>
- <Directory "<%= cgi_binpath %>/">
- AuthType Basic
- AuthName "Access fuer <%= servername %>"
- AuthUserFile <%= real_htpasswd_path %>
- require valid-user
- </Directory>
- <%- end -%>
- ScriptAlias /cgi-bin/ <%= cgi_binpath %>/
- <%- end -%>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
-
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
-
- ScriptAlias /cgi-bin/ <%= cgi_binpath %>/
- <%- unless htpasswd_file.to_s == 'absent' then -%>
- <Directory "<%= cgi_binpath %>/">
- AuthType Basic
- AuthName "Access fuer <%= servername %>"
- AuthUserFile <%= real_htpasswd_path %>
- require valid-user
- </Directory>
- <%- end -%>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-</IfDefine>
-<IfDefine !HttpdLocal>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
- DirectoryIndex index.htm index.html index.pl
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.pl/?.*)$ http://127.0.0.1/$1
- <%- else -%>
- ProxyPass / http://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / http://127.0.0.1/
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s == 'static-itk' then -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
-
- <%- unless htpasswd_file.to_s == 'absent' then -%>
- <Directory "<%= cgi_binpath %>/">
- AuthType Basic
- AuthName "Access fuer <%= servername %>"
- AuthUserFile <%= real_htpasswd_path %>
- require valid-user
- </Directory>
- <%- end -%>
- ScriptAlias /cgi-bin/ <%= cgi_binpath %>/
- <%- end -%>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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.pl
-
- ProxyPreserveHost On
- ProxyRequests off
- SSLProxyEngine On
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.pl/?.*)$ https://127.0.0.1/$1
- <%- else -%>
- ProxyPass / https://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / https://127.0.0.1/
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- <%- unless run_mode.to_s == 'static-itk' -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
-
- <%- if htpasswd_file.to_s == 'absent' then -%>
- <Directory "<%= cgi_binpath %>/">
- AuthType Basic
- AuthName "Access fuer <%= servername %>"
- AuthUserFile <%= real_htpasswd_path %>
- require valid-user
- </Directory>
- <%- end -%>
- ScriptAlias /cgi-bin/ <%= cgi_binpath %>/
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-</IfDefine>
-<%- end -%>
diff --git a/templates/vhosts/php/CentOS.erb b/templates/vhosts/php/CentOS.erb
deleted file mode 120000
index ef6a366..0000000
--- a/templates/vhosts/php/CentOS.erb
+++ /dev/null
@@ -1 +0,0 @@
-php.erb \ No newline at end of file
diff --git a/templates/vhosts/php/Debian.erb b/templates/vhosts/php/Debian.erb
deleted file mode 120000
index ef6a366..0000000
--- a/templates/vhosts/php/Debian.erb
+++ /dev/null
@@ -1 +0,0 @@
-php.erb \ No newline at end of file
diff --git a/templates/vhosts/php/partial.erb b/templates/vhosts/php/partial.erb
new file mode 100644
index 0000000..dae201a
--- /dev/null
+++ b/templates/vhosts/php/partial.erb
@@ -0,0 +1,7 @@
+ <Directory "<%= documentroot %>/">
+<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %>
+
+<%= scope.function_template('apache/vhosts/partials/php_settings.erb') %>
+
+<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
+ </Directory> \ No newline at end of file
diff --git a/templates/vhosts/php/php.erb b/templates/vhosts/php/php.erb
deleted file mode 100644
index b722b1e..0000000
--- a/templates/vhosts/php/php.erb
+++ /dev/null
@@ -1,195 +0,0 @@
-# <%= servername %>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<IfDefine HttpdLocal>
-<%- end -%>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- if php_safe_mode.to_s == 'false' -%>
- php_admin_flag safe_mode Off
- <%- end -%>
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%- if php_use_smarty.to_s == 'true' -%>/usr/share/php/Smarty/:<%- end -%><%- if php_use_pear.to_s == 'true' -%>/usr/share/pear/:<%- end -%><%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
- </Directory>
- <%- end -%>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
-
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- if php_safe_mode.to_s == 'false' -%>
- php_admin_flag safe_mode Off
- <%- end -%>
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%- if php_use_smarty.to_s == 'true' -%>/usr/share/php/Smarty/:<%- end -%><%- if php_use_pear.to_s == 'true' -%>/usr/share/pear/:<%- end -%><%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
- </Directory>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-</IfDefine>
-<IfDefine !HttpdLocal>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
- DirectoryIndex index.htm index.html index.php
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ http://127.0.0.1/$1
- <%- else -%>
- ProxyPass / http://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / http://127.0.0.1/
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s == 'static-itk' then -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <%- end -%>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- SSLProxyEngine On
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ https://127.0.0.1/$1
- <%- else -%>
- ProxyPass / https://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / https://127.0.0.1/
-
- <%- if run_mode.to_s == 'static-itk' -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-</IfDefine>
-<%- end -%>
-
diff --git a/templates/vhosts/php_drupal/partial.erb b/templates/vhosts/php_drupal/partial.erb
new file mode 100644
index 0000000..07e0d94
--- /dev/null
+++ b/templates/vhosts/php_drupal/partial.erb
@@ -0,0 +1,26 @@
+ <Directory "<%= documentroot %>/">
+<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %>
+
+
+<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
+
+<%= scope.function_template('apache/vhosts/partials/php_settings.erb') %>
+
+ # Protect files and directories from prying eyes.
+ <FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
+ Order allow,deny
+ </FilesMatch>
+
+ # Customized error messages.
+ ErrorDocument 404 /index.php
+
+ RewriteEngine on
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
+ </Directory>
+ <Directory "<%= documentroot %>/files/">
+ SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
+ Options None
+ Options +FollowSymLinks
+ </Directory>
diff --git a/templates/vhosts/php_drupal/php_drupal.erb b/templates/vhosts/php_drupal/php_drupal.erb
deleted file mode 100644
index 0e6faae..0000000
--- a/templates/vhosts/php_drupal/php_drupal.erb
+++ /dev/null
@@ -1,275 +0,0 @@
-# <%= servername %>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<IfDefine HttpdLocal>
-<%- end -%>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
-
- php_value magic_quotes_gpc 0
- php_value register_globals 0
- php_value session.auto_start 0
- php_value mbstring.http_input pass
- php_value mbstring.http_output pass
- php_value mbstring.encoding_translation 0
-
- # Protect files and directories from prying eyes.
- <FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
- Order allow,deny
- </FilesMatch>
-
- # Customized error messages.
- ErrorDocument 404 /index.php
-
- RewriteEngine on
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
- </Directory>
- <Directory "<%= documentroot %>/files/">
- SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
- Options None
- Options +FollowSymLinks
- </Directory>
- <%- end -%>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
-
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
-
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
- <%- end -%>
-
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
-
- php_value magic_quotes_gpc 0
- php_value register_globals 0
- php_value session.auto_start 0
- php_value mbstring.http_input pass
- php_value mbstring.http_output pass
- php_value mbstring.encoding_translation 0
-
- # Protect files and directories from prying eyes.
- <FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
- Order allow,deny
- </FilesMatch>
-
- # Customized error messages.
- ErrorDocument 404 /index.php
-
- RewriteEngine on
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
- </Directory>
- <Directory "<%= documentroot %>/files/">
- SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
- Options None
- Options +FollowSymLinks
- </Directory>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-</IfDefine>
-<IfDefine !HttpdLocal>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
- DirectoryIndex index.htm index.html index.php
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ http://127.0.0.1/$1
- <%- else -%>
- ProxyPass / http://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / http://127.0.0.1/
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
-
- <%- if run_mode.to_s == 'static-itk' then -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
-
- # Protect files and directories from prying eyes.
- <FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
- Order allow,deny
- </FilesMatch>
-
- # Customized error messages.
- ErrorDocument 404 /index.php
-
- RewriteEngine on
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
- </Directory>
- <Directory "<%= documentroot %>/files/">
- SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
- Options None
- Options +FollowSymLinks
- </Directory>
- <%- end -%>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- SSLProxyEngine On
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ https://127.0.0.1/$1
- <%- else -%>
- ProxyPass / https://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / https://127.0.0.1/
-
- <%- if run_mode.to_s == 'static-itk' -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
-
- # Protect files and directories from prying eyes.
- <FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
- Order allow,deny
- </FilesMatch>
-
- # Customized error messages.
- ErrorDocument 404 /index.php
-
- RewriteEngine on
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
- </Directory>
- <Directory "<%= documentroot %>/files/">
- SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
- Options None
- Options +FollowSymLinks
- </Directory>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-</IfDefine>
-<%- end -%>
diff --git a/templates/vhosts/php_gallery2/CentOS.erb b/templates/vhosts/php_gallery2/CentOS.erb
deleted file mode 120000
index 33f1633..0000000
--- a/templates/vhosts/php_gallery2/CentOS.erb
+++ /dev/null
@@ -1 +0,0 @@
-php_gallery2.erb \ No newline at end of file
diff --git a/templates/vhosts/php_gallery2/Debian.erb b/templates/vhosts/php_gallery2/Debian.erb
deleted file mode 120000
index 33f1633..0000000
--- a/templates/vhosts/php_gallery2/Debian.erb
+++ /dev/null
@@ -1 +0,0 @@
-php_gallery2.erb \ No newline at end of file
diff --git a/templates/vhosts/php_gallery2/partial.erb b/templates/vhosts/php_gallery2/partial.erb
new file mode 100644
index 0000000..05cc9f4
--- /dev/null
+++ b/templates/vhosts/php_gallery2/partial.erb
@@ -0,0 +1,16 @@
+ <Directory "<%= documentroot %>/">
+<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %>
+
+<%= scope.function_template('apache/vhosts/partials/php_settings.erb') %>
+
+<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
+
+<% if vhost_part != :ssl -%>
+ # Always rewrite login's
+ # Source: http://gallery.menalto.com/node/30558
+ RewriteEngine On
+ RewriteCond %{HTTP_COOKIE} ^GALLERYSID= [OR]
+ RewriteCond %{QUERY_STRING} subView=core\.UserLogin
+ RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
+<% end -%>
+ </Directory> \ No newline at end of file
diff --git a/templates/vhosts/php_gallery2/php_gallery2.erb b/templates/vhosts/php_gallery2/php_gallery2.erb
deleted file mode 100644
index b0a6591..0000000
--- a/templates/vhosts/php_gallery2/php_gallery2.erb
+++ /dev/null
@@ -1,215 +0,0 @@
-# <%= servername %>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<IfDefine HttpdLocal>
-<%- end -%>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
-<%= scope.function_template('apache/vhosts/partials/php_settings.erb') %>
- # Always rewrite login's
- # Source: http://gallery.menalto.com/node/30558
- RewriteEngine On
- RewriteCond %{HTTP_COOKIE} ^GALLERYSID= [OR]
- RewriteCond %{QUERY_STRING} subView=core\.UserLogin
- RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
- # https -> see below
- # Then, unset baseUri in config.php (to keep Gallery from trying to redirect users to either HTTP or HTTPS):
- # $gallery->setConfig('baseUri', '');
- </Directory>
- <%- end -%>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
-
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
- <%- end -%>
-
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- php_admin_flag safe_mode Off
- php_admin_value output_buffering Off
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>:<%= gdatadir %><%= ":#{real_upload_dir.to_s}" if upload_dir.to_s != 'absent' %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
- # turn allow_url_fopen on for the extension manager fetch
- php_admin_value allow_url_fopen On
-
- # Always rewrite login's (see above)
- RewriteEngine On
- RewriteCond %{HTTP_COOKIE} =""
- RewriteCond %{REQUEST_METHOD} =GET
- RewriteCond %{QUERY_STRING} !subView=core\.UserLogin
- RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
- </Directory>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-</IfDefine>
-<IfDefine !HttpdLocal>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
- DirectoryIndex index.htm index.html index.php
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ http://127.0.0.1/$1
- <%- else -%>
- ProxyPass / http://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / http://127.0.0.1/
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s == 'static-itk' then -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
-
- # Always rewrite login's
- # Source: http://gallery.menalto.com/node/30558
- RewriteEngine On
- RewriteCond %{HTTP_COOKIE} ^GALLERYSID= [OR]
- RewriteCond %{QUERY_STRING} subView=core\.UserLogin
- RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
- # https -> see below
- # Then, unset baseUri in config.php (to keep Gallery from trying to redirect users to either HTTP or HTTPS):
- # $gallery->setConfig('baseUri', '');
- </Directory>
- <%- end -%>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- SSLProxyEngine On
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ https://127.0.0.1/$1
- <%- else -%>
- ProxyPass / https://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / https://127.0.0.1/
-
- <%- if run_mode.to_s == 'static-itk' -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- # Always rewrite login's (see above)
- RewriteEngine On
- RewriteCond %{HTTP_COOKIE} =""
- RewriteCond %{REQUEST_METHOD} =GET
- RewriteCond %{QUERY_STRING} !subView=core\.UserLogin
- RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
- </Directory>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-</IfDefine>
-<%- end -%>
diff --git a/templates/vhosts/php_joomla/CentOS.erb b/templates/vhosts/php_joomla/CentOS.erb
deleted file mode 120000
index 307fc29..0000000
--- a/templates/vhosts/php_joomla/CentOS.erb
+++ /dev/null
@@ -1 +0,0 @@
-php_joomla.erb \ No newline at end of file
diff --git a/templates/vhosts/php_joomla/Debian.erb b/templates/vhosts/php_joomla/Debian.erb
deleted file mode 120000
index 307fc29..0000000
--- a/templates/vhosts/php_joomla/Debian.erb
+++ /dev/null
@@ -1 +0,0 @@
-php_joomla.erb \ No newline at end of file
diff --git a/templates/vhosts/php_joomla/php_joomla.erb b/templates/vhosts/php_joomla/php_joomla.erb
index a0e013d..fa095ff 100644
--- a/templates/vhosts/php_joomla/php_joomla.erb
+++ b/templates/vhosts/php_joomla/php_joomla.erb
@@ -1,157 +1,13 @@
-# <%= servername %>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<IfDefine HttpdLocal>
-<%- end -%>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- Include include.d/joomla.inc
-
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
- </Directory>
- <%- end -%>
-
- <Directory "<%= documentroot %>/administrator/">
- RewriteEngine on
-
- # Rewrite URLs to https that go for the admin area
- RewriteCond %{REMOTE_ADDR} !^127\.[0-9]+\.[0-9]+\.[0-9]+$
- RewriteCond %{HTTPS} !=on
- RewriteCond %{REQUEST_URI} (.*/administrator/.*)
- RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]
- </Directory>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
-
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
-
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
- <%- end -%>
-
<Directory "<%= documentroot %>/">
- Include include.d/joomla.inc
+<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %>
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
+<%= scope.function_template('apache/vhosts/partials/php_settings.erb') %>
- <%- end -%>
<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
- </Directory>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-</IfDefine>
-<IfDefine !HttpdLocal>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
- DirectoryIndex index.htm index.html index.php
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ http://127.0.0.1/$1
- <%- else -%>
- ProxyPass / http://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / http://127.0.0.1/
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
- <%- end -%>
- <%- if run_mode.to_s == 'static-itk' then -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
Include include.d/joomla.inc
-
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
</Directory>
+
<Directory "<%= documentroot %>/administrator/">
RewriteEngine on
@@ -160,57 +16,4 @@
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} (.*/administrator/.*)
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]
- </Directory>
- <%- end -%>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- SSLProxyEngine On
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ https://127.0.0.1/$1
- <%- else -%>
- ProxyPass / https://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / https://127.0.0.1/
-
- <%- if run_mode.to_s == 'static-itk' -%>
- <Directory "<%= documentroot %>/">
- Include include.d/joomla.inc
-
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-</IfDefine>
-<%- end -%>
+ </Directory> \ No newline at end of file
diff --git a/templates/vhosts/php_mediawiki/CentOS.erb b/templates/vhosts/php_mediawiki/CentOS.erb
deleted file mode 120000
index 8080262..0000000
--- a/templates/vhosts/php_mediawiki/CentOS.erb
+++ /dev/null
@@ -1 +0,0 @@
-php_mediawiki.erb \ No newline at end of file
diff --git a/templates/vhosts/php_mediawiki/Debian.erb b/templates/vhosts/php_mediawiki/Debian.erb
deleted file mode 120000
index 8080262..0000000
--- a/templates/vhosts/php_mediawiki/Debian.erb
+++ /dev/null
@@ -1 +0,0 @@
-php_mediawiki.erb \ No newline at end of file
diff --git a/templates/vhosts/php_mediawiki/php_mediawiki.erb b/templates/vhosts/php_mediawiki/php_mediawiki.erb
deleted file mode 100644
index 12830b5..0000000
--- a/templates/vhosts/php_mediawiki/php_mediawiki.erb
+++ /dev/null
@@ -1,185 +0,0 @@
-# <%= servername %>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<IfDefine HttpdLocal>
-<%- end -%>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%><%- unless options.to_s.include?('+FollowSymLinks') -%> +FollowSymLinks<% end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- php_admin_value safe_mode off
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir /var/www/mediawiki/:<%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- </Directory>
- <%- end -%>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
-
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
-
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
- <%- end -%>
-
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- php_admin_value safe_mode off
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir /var/www/mediawiki/:<%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- </Directory>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-</IfDefine>
-<IfDefine !HttpdLocal>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
- DirectoryIndex index.htm index.html index.php
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ http://127.0.0.1/$1
- <%- else -%>
- ProxyPass / http://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / http://127.0.0.1/
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s == 'static-itk' then -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%><%- unless options.to_s.include?('+FollowSymLinks') -%> +FollowSymLinks<% end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <%- end -%>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- SSLProxyEngine On
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ https://127.0.0.1/$1
- <%- else -%>
- ProxyPass / https://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / https://127.0.0.1/
-
- <%- if run_mode.to_s == 'static-itk' -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-</IfDefine>
-<%- end -%>
diff --git a/templates/vhosts/php_silverstripe/partial.erb b/templates/vhosts/php_silverstripe/partial.erb
new file mode 100644
index 0000000..a398829
--- /dev/null
+++ b/templates/vhosts/php_silverstripe/partial.erb
@@ -0,0 +1,16 @@
+<% if vhost_part != :ssl && ![false,'false'].include?(ssl_mode) -%>
+ # silverstripe
+ RedirectMatch /admin(.*) https://<%= servername %>/admin$1
+ RedirectMatch /Security(.*) https://<%= servername %>/Security$1
+
+<% end -%>
+ <Directory "<%= documentroot %>/">
+
+<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %>
+
+<%= scope.function_template('apache/vhosts/partials/php_settings.erb') %>
+
+<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
+
+ Include include.d/silverstripe.inc
+ </Directory> \ No newline at end of file
diff --git a/templates/vhosts/php_silverstripe/php_silverstripe.erb b/templates/vhosts/php_silverstripe/php_silverstripe.erb
deleted file mode 100644
index e72c603..0000000
--- a/templates/vhosts/php_silverstripe/php_silverstripe.erb
+++ /dev/null
@@ -1,268 +0,0 @@
-# <%= servername %>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<IfDefine HttpdLocal>
-<%- end -%>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- # silverstripe
- RedirectMatch /admin(.*) https://<%= servername %>/admin$1
- RedirectMatch /Security(.*) https://<%= servername %>/Security$1
-
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
-
- # silverstripe .htaccess
- <Files *.ss>
- Order deny,allow
- Deny from all
- #Allow from 127.0.0.1
- </Files>
-
- <IfModule mod_rewrite.c>
- RewriteEngine On
- #RewriteBase /
-
- RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)
-
- RewriteCond %{REQUEST_URI} ^(.*)$
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
- </IfModule>
- </Directory>
- <%- end -%>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
-
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
- <%- end -%>
-
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
- # turn allow_url_fopen on for the extension manager fetch
- php_admin_value allow_url_fopen On
-
- # silverstripe .htaccess
- <Files *.ss>
- Order deny,allow
- Deny from all
- #Allow from 127.0.0.1
- </Files>
- <IfModule mod_rewrite.c>
- RewriteEngine On
- #RewriteBase /
-
- RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)
-
- RewriteCond %{REQUEST_URI} ^(.*)$
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
- </IfModule>
- </Directory>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-</IfDefine>
-<IfDefine !HttpdLocal>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
- DirectoryIndex index.htm index.html index.php
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ http://127.0.0.1/$1
- <%- else -%>
- ProxyPass / http://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / http://127.0.0.1/
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- # silverstripe
- RedirectMatch /admin(.*) https://<%= servername %>/admin$1
- RedirectMatch /Security(.*) https://<%= servername %>/Security$1
-
- <%- if run_mode.to_s == 'static-itk' then -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- # silverstripe .htaccess
- <Files *.ss>
- Order deny,allow
- Deny from all
- #Allow from 127.0.0.1
- </Files>
-
- <IfModule mod_rewrite.c>
- RewriteEngine On
- #RewriteBase /
-
- RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)
-
- RewriteCond %{REQUEST_URI} ^(.*)$
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
- </IfModule>
- </Directory>
- <%- end -%>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- SSLProxyEngine On
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ https://127.0.0.1/$1
- <%- else -%>
- ProxyPass / https://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / https://127.0.0.1/
-
- <%- if run_mode.to_s == 'static-itk' -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
-
- # silverstripe .htaccess
- <Files *.ss>
- Order deny,allow
- Deny from all
- #Allow from 127.0.0.1
- </Files>
- <IfModule mod_rewrite.c>
- RewriteEngine On
- #RewriteBase /
-
- RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)
-
- RewriteCond %{REQUEST_URI} ^(.*)$
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
- </IfModule>
- </Directory>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-</IfDefine>
-<%- end -%>
-
diff --git a/templates/vhosts/php_simplemachine/CentOS.erb b/templates/vhosts/php_simplemachine/CentOS.erb
deleted file mode 120000
index de3c614..0000000
--- a/templates/vhosts/php_simplemachine/CentOS.erb
+++ /dev/null
@@ -1 +0,0 @@
-php_simplemachine.erb \ No newline at end of file
diff --git a/templates/vhosts/php_simplemachine/Debian.erb b/templates/vhosts/php_simplemachine/Debian.erb
deleted file mode 120000
index de3c614..0000000
--- a/templates/vhosts/php_simplemachine/Debian.erb
+++ /dev/null
@@ -1 +0,0 @@
-php_simplemachine.erb \ No newline at end of file
diff --git a/templates/vhosts/php_simplemachine/php_simplemachine.erb b/templates/vhosts/php_simplemachine/php_simplemachine.erb
deleted file mode 100644
index 5316267..0000000
--- a/templates/vhosts/php_simplemachine/php_simplemachine.erb
+++ /dev/null
@@ -1,182 +0,0 @@
-# <%= servername %>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<IfDefine HttpdLocal>
-<%- end -%>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- </Directory>
- <%- end -%>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
-
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
- <%- end -%>
-
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- </Directory>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-</IfDefine>
-<IfDefine !HttpdLocal>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
- DirectoryIndex index.htm index.html index.php
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ http://127.0.0.1/$1
- <%- else -%>
- ProxyPass / http://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / http://127.0.0.1/
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s == 'static-itk' then -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <%- end -%>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- SSLProxyEngine On
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ https://127.0.0.1/$1
- <%- else -%>
- ProxyPass / https://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / https://127.0.0.1/
-
- <%- if run_mode.to_s == 'static-itk' -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-</IfDefine>
-<%- end -%>
diff --git a/templates/vhosts/php_spip/CentOS.erb b/templates/vhosts/php_spip/CentOS.erb
deleted file mode 120000
index 1ca4aec..0000000
--- a/templates/vhosts/php_spip/CentOS.erb
+++ /dev/null
@@ -1 +0,0 @@
-php_spip.erb \ No newline at end of file
diff --git a/templates/vhosts/php_spip/Debian.erb b/templates/vhosts/php_spip/Debian.erb
deleted file mode 120000
index 1ca4aec..0000000
--- a/templates/vhosts/php_spip/Debian.erb
+++ /dev/null
@@ -1 +0,0 @@
-php_spip.erb \ No newline at end of file
diff --git a/templates/vhosts/php_spip/php_spip.erb b/templates/vhosts/php_spip/php_spip.erb
deleted file mode 100644
index 9f93c18..0000000
--- a/templates/vhosts/php_spip/php_spip.erb
+++ /dev/null
@@ -1,194 +0,0 @@
-# <%= servername %>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<IfDefine HttpdLocal>
-<%- end -%>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- if php_safe_mode.to_s == 'false' -%>
- php_admin_flag safe_mode Off
- <%- end -%>
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%- if php_use_smarty.to_s == 'true' -%>/usr/share/php/Smarty/:<%- end -%><%- if php_use_pear.to_s == 'true' -%>/usr/share/pear/:<%- end -%><%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
- </Directory>
- <%- end -%>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
-
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
- <%- end -%>
-
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- if php_safe_mode.to_s == 'false' -%>
- php_admin_flag safe_mode Off
- <%- end -%>
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%- if php_use_smarty.to_s == 'true' -%>/usr/share/php/Smarty/:<%- end -%><%- if php_use_pear.to_s == 'true' -%>/usr/share/pear/:<%- end -%><%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
- </Directory>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-</IfDefine>
-<IfDefine !HttpdLocal>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
- DirectoryIndex index.htm index.html index.php
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ http://127.0.0.1/$1
- <%- else -%>
- ProxyPass / http://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / http://127.0.0.1/
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s == 'static-itk' then -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <%- end -%>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- SSLProxyEngine On
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ https://127.0.0.1/$1
- <%- else -%>
- ProxyPass / https://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / https://127.0.0.1/
-
- <%- if run_mode.to_s == 'static-itk' -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-</IfDefine>
-<%- end -%>
diff --git a/templates/vhosts/php_typo3/partial.erb b/templates/vhosts/php_typo3/partial.erb
new file mode 100644
index 0000000..776fff2
--- /dev/null
+++ b/templates/vhosts/php_typo3/partial.erb
@@ -0,0 +1,10 @@
+<%= scope.function_template('apache/vhosts/php/partial.erb') %>
+ <Directory "<%= documentroot %>/typo3/">
+ RewriteEngine on
+
+ # Rewrite URLs to https that go for the admin area
+ RewriteCond %{REMOTE_ADDR} !^127\.[0-9]+\.[0-9]+\.[0-9]+$
+ RewriteCond %{HTTPS} !=on
+ RewriteCond %{REQUEST_URI} (.*/typo3/.*)
+ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]
+ </Directory> \ No newline at end of file
diff --git a/templates/vhosts/php_typo3/php_typo3.erb b/templates/vhosts/php_typo3/php_typo3.erb
deleted file mode 100644
index b1a632f..0000000
--- a/templates/vhosts/php_typo3/php_typo3.erb
+++ /dev/null
@@ -1,209 +0,0 @@
-# <%= servername %>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<IfDefine HttpdLocal>
-<%- end -%>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
- <%- if ssl_mode.to_s == 'force' then -%>
-
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
- <%- end -%>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
-
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
- <%- end -%>
-
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
- </Directory>
- <Directory "<%= documentroot %>/typo3/">
- RewriteEngine on
-
- # Rewrite URLs to https that go for the admin area
- RewriteCond %{REMOTE_ADDR} !^127\.[0-9]+\.[0-9]+\.[0-9]+$
- RewriteCond %{HTTPS} !=on
- RewriteCond %{REQUEST_URI} (.*/typo3/.*)
- RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]
- </Directory>
- <%- end -%>
-
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
-
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
- <%- end -%>
-
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
- # turn allow_url_fopen on for the extension manager fetch
- php_admin_value allow_url_fopen On
- </Directory>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-</IfDefine>
-<IfDefine !HttpdLocal>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
- DirectoryIndex index.htm index.html index.php
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ http://127.0.0.1/$1
- <%- else -%>
- ProxyPass / http://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / http://127.0.0.1/
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s == 'static-itk' then -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <Directory "<%= documentroot %>/typo3/">
- RewriteEngine on
-
- # Rewrite URLs to https that go for the admin area
- RewriteCond %{REMOTE_ADDR} !^127\.[0-9]+\.[0-9]+\.[0-9]+$
- RewriteCond %{HTTPS} !=on
- RewriteCond %{REQUEST_URI} (.*/typo3/.*)
- RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]
- </Directory>
- <%- end -%>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- SSLProxyEngine On
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ https://127.0.0.1/$1
- <%- else -%>
- ProxyPass / https://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / https://127.0.0.1/
-
- <%- if run_mode.to_s == 'static-itk' -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-</IfDefine>
-<%- end -%>
diff --git a/templates/vhosts/php_wordpress/CentOS.erb b/templates/vhosts/php_wordpress/CentOS.erb
deleted file mode 120000
index 36dc938..0000000
--- a/templates/vhosts/php_wordpress/CentOS.erb
+++ /dev/null
@@ -1 +0,0 @@
-php_wordpress.erb \ No newline at end of file
diff --git a/templates/vhosts/php_wordpress/Debian.erb b/templates/vhosts/php_wordpress/Debian.erb
deleted file mode 120000
index 36dc938..0000000
--- a/templates/vhosts/php_wordpress/Debian.erb
+++ /dev/null
@@ -1 +0,0 @@
-php_wordpress.erb \ No newline at end of file
diff --git a/templates/vhosts/php_wordpress/php_wordpress.erb b/templates/vhosts/php_wordpress/php_wordpress.erb
deleted file mode 100644
index 2811749..0000000
--- a/templates/vhosts/php_wordpress/php_wordpress.erb
+++ /dev/null
@@ -1,189 +0,0 @@
-# <%= servername %>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<IfDefine HttpdLocal>
-<%- end -%>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
- </Directory>
- <%- end -%>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
-
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
- <%- end -%>
-
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- php_admin_flag engine on
- <%- unless php_default_charset.to_s == 'absent' then -%>
- php_admin_value default_charset <%= php_default_charset %>
- <%- end -%>
- php_admin_value open_basedir <%= documentroot %>:<%= real_php_upload_tmp_dir %>:<%= real_php_session_save_path %>
- php_admin_value upload_tmp_dir <%= real_php_upload_tmp_dir %>
- php_admin_value session.save_path <%= real_php_session_save_path %>
- <%- unless php_safe_mode_exec_bins.to_s == 'absent' then -%>
- php_admin_value safe_mode_exec_dir <%= real_php_safe_mode_exec_bin_dir %>
- <%- end -%>
- </Directory>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-</IfDefine>
-<IfDefine !HttpdLocal>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
- DirectoryIndex index.htm index.html index.php
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ http://127.0.0.1/$1
- <%- else -%>
- ProxyPass / http://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / http://127.0.0.1/
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
- <%- if run_mode.to_s == 'static-itk' then -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <%- end -%>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- SSLProxyEngine On
- <%- if run_mode.to_s == 'static-itk' -%>
- ProxyPassMatch ^/(.*\.php/?.*)$ https://127.0.0.1/$1
- <%- else -%>
- ProxyPass / https://127.0.0.1/
- <%- end -%>
- ProxyPassReverse / https://127.0.0.1/
-
- <%- if run_mode.to_s == 'static-itk' -%>
- <Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- </Directory>
- <%- end -%>
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-</IfDefine>
-<%- end -%>
-
diff --git a/templates/vhosts/static/partial.erb b/templates/vhosts/static/partial.erb
index 03bd2f8..78dc925 100644
--- a/templates/vhosts/static/partial.erb
+++ b/templates/vhosts/static/partial.erb
@@ -1,8 +1,5 @@
<Directory "<%= documentroot %>/">
- AllowOverride <%= allow_override %>
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<%- end -%>
+<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %>
- <%- end -%>
<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
</Directory> \ No newline at end of file
diff --git a/templates/vhosts/webdav/partial.erb b/templates/vhosts/webdav/partial.erb
new file mode 100644
index 0000000..2f78d7b
--- /dev/null
+++ b/templates/vhosts/webdav/partial.erb
@@ -0,0 +1,21 @@
+ DAVLockDB <%= real_dav_db_dir %>/DAVLock
+ <Directory "<%= documentroot %>/">
+ Dav on
+ AllowOverride None
+ <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
+ Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- unless options.include?('Indexes') then -%> Indexes<%- end -%>
+
+ <%- else -%>
+ Options Indexes
+
+ <%- end -%>
+<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
+ <%- if ldap_auth.to_s == 'true' then -%>
+ Include include.d/ldap_auth.inc
+ <%- unless ldap_user.to_s == 'any' -%>
+ Require ldap-user <%= ldap_user.to_s %>
+ <%- else -%>
+ Require valid-user
+ <%- end -%>
+ <%- end -%>
+ </Directory>
diff --git a/templates/vhosts/webdav/webdav.erb b/templates/vhosts/webdav/webdav.erb
deleted file mode 100644
index ad5f5e4..0000000
--- a/templates/vhosts/webdav/webdav.erb
+++ /dev/null
@@ -1,161 +0,0 @@
-# <%= servername %>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<IfDefine HttpdLocal>
-<%- end -%>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
-
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
-
- <%- end -%>
- <%- if not ssl_mode.to_s == 'force' then -%>
- DAVLockDB <%= real_dav_db_dir %>/DAVLock
- <Directory "<%= documentroot %>/">
- Dav on
- AllowOverride None
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- unless options.include?('Indexes') then -%> Indexes<%- end -%>
-
- <%- else -%>
- Options Indexes
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- <%- if ldap_auth.to_s == 'true' then -%>
- Include include.d/ldap_auth.inc
- <%- unless ldap_user.to_s == 'any' -%>
- Require ldap-user <%= ldap_user.to_s %>
- <%- else -%>
- Require valid-user
- <%- end -%>
- <%- end -%>
- </Directory>
- <%- end -%>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
- <%- if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%>
-
- <IfModule mpm_itk_module>
- AssignUserId <%= run_uid+" "+run_gid %>
- </IfModule>
- <%- end -%>
-
- DAVLockDB <%= real_dav_db_dir %>/DAVLock
- <Directory "<%= documentroot %>/">
- Dav on
- AllowOverride None
- <%- if options.to_s != 'absent' or do_includes.to_s == 'true' then -%>
- Options <%- unless options.to_s == 'absent' then -%><%= options %><%- end -%><%- unless options.include?('Indexes') then -%> Indexes<%- end -%>
-
- <%- else -%>
- Options Indexes
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/authentication.erb') %>
- <%- if ldap_auth.to_s == 'true' then -%>
- Include include.d/ldap_auth.inc
- <%- unless ldap_user.to_s == 'any' -%>
- Require ldap-user <%= ldap_user.to_s %>
- <%- else -%>
- Require valid-user
- <%- end -%>
- <%- end -%>
- </Directory>
-
- <%- unless run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
- <%- end -%>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-<%- if run_mode.to_s =~ /(proxy\-|static\-)itk/ -%>
-</IfDefine>
-<IfDefine !HttpdLocal>
-<%- unless ssl_mode.to_s == 'only' then -%>
-<VirtualHost *:80>
-<% scope.unsetvar('vhost_part')
- scope.setvar('vhost_part',:normal) -%>
- <%= scope.function_template('apache/vhosts/partials/header_default.erb') %>
-<% scope.unsetvar('vhost_part') -%>
-
-<%= scope.function_template('apache/vhosts/partials/logs.erb') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- ProxyPass / http://127.0.0.1/
- ProxyPassReverse / http://127.0.0.1/
-
- <%- if ssl_mode.to_s == 'force' then -%>
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L]
-
- <%- end -%>
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-
-<%- unless ssl_mode.to_s == 'false' then -%>
-<VirtualHost *:443>
-<% 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') %>
-
- ProxyPreserveHost On
- ProxyRequests off
- SSLProxyEngine On
- ProxyPass / https://127.0.0.1/
- ProxyPassReverse / https://127.0.0.1/
-
-<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %>
-
- <%- unless additional_options.to_s == 'absent' then -%>
- <%= additional_options %>
- <%- end -%>
-</VirtualHost>
-<%- end -%>
-</IfDefine>
-<%- end -%>