diff options
Diffstat (limited to 'templates/vhosts/static/OpenBSD.erb')
-rw-r--r-- | templates/vhosts/static/OpenBSD.erb | 28 |
1 files changed, 24 insertions, 4 deletions
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 %> |