diff options
Diffstat (limited to 'templates/vhosts')
-rw-r--r-- | templates/vhosts/php/CentOS.erb | 12 | ||||
-rw-r--r-- | templates/vhosts/static/OpenBSD.erb | 28 |
2 files changed, 34 insertions, 6 deletions
diff --git a/templates/vhosts/php/CentOS.erb b/templates/vhosts/php/CentOS.erb index 53251ad..96e5d27 100644 --- a/templates/vhosts/php/CentOS.erb +++ b/templates/vhosts/php/CentOS.erb @@ -12,9 +12,17 @@ <Directory "<%= documentroot %>"> AllowOverride <%= allow_override %> - <%- unless options.to_s == 'absent' then -%> + <%- unless options.to_s == 'absent' then -%> Options <%= options %> - <%- end %> + <%- end %> + <%- unless htpasswd_file.to_s == 'absent' then -%> + + AuthType Basic + AuthName "Access fuer <%= servername %>" + AuthUserFile <%= htpasswd_path %> + require valid-user + + <%- end %> php_admin_flag engine on php_admin_value open_basedir <%= documentroot %>:<%= php_upload_tmp_dir %>:<%= php_session_save_path %> php_admin_value upload_tmp_dir <%= php_upload_tmp_dir %> diff --git a/templates/vhosts/static/OpenBSD.erb b/templates/vhosts/static/OpenBSD.erb index d5714f0..b3b8342 100644 --- a/templates/vhosts/static/OpenBSD.erb +++ b/templates/vhosts/static/OpenBSD.erb @@ -14,9 +14,19 @@ Redirect permanent / https://<%= servername %>/ <%- end %> - <%- unless options.to_s == 'absent' then -%> + <%- if options.to_s != 'absent' or htpasswd_file.to_s != 'absent' then -%> <Directory "<%= documentroot %>"> - Options <%= options %> + <%- unless options.to_s == 'absent' then %> + Options <%= options %> + + <%- end %> + <%- unless htpasswd_file.to_s == 'absent' then -%> + AuthType Basic + AuthName "Access fuer <%= servername %>" + AuthUserFile <%= htpasswd_path %> + require valid-user + + <%- end %> </Directory> <%- end %> @@ -37,9 +47,19 @@ ErrorLog <%= logdir %>/error_log CustomLog <%= logdir %>/access_log combined - <%- unless options.to_s == 'absent' then -%> + <%- if options.to_s != 'absent' or htpasswd_file.to_s != 'absent' then -%> <Directory "<%= documentroot %>"> - Options <%= options %> + <%- unless options.to_s == 'absent' then %> + Options <%= options %> + + <%- end %> + <%- unless htpasswd_file.to_s == 'absent' then -%> + AuthType Basic + AuthName "Access fuer <%= servername %>" + AuthUserFile <%= htpasswd_path %> + require valid-user + + <%- end %> </Directory> <%- end %> |