diff --git a/templates/apache_httpd/httpd-nagios.conf.erb b/templates/apache_httpd/httpd-nagios.conf.erb index 75a08f2e..2487dee0 100644 --- a/templates/apache_httpd/httpd-nagios.conf.erb +++ b/templates/apache_httpd/httpd-nagios.conf.erb @@ -9,10 +9,12 @@ ScriptAlias /nagios/cgi-bin/ /usr/<%= scope.lookupvar("nagios::params::libdir") Allow from <%= val %> <% end -%> <% end -%> +<%if @apache_httpd_htpasswd_source -%> AuthType Basic AuthUserFile /etc/nagios/.htpasswd AuthName "Nagios" Require valid-user +<% end -%> Alias /nagios/ /usr/share/nagios/html/ @@ -26,10 +28,12 @@ Alias /nagios/ /usr/share/nagios/html/ Allow from <%= val %> <% end -%> <% end -%> +<%if @apache_httpd_htpasswd_source -%> AuthType Basic AuthUserFile /etc/nagios/.htpasswd AuthName "Nagios" Require valid-user +<% end -%> # For SSL-servers @@ -57,4 +61,3 @@ Alias /nagios/ /usr/share/nagios/html/ # AuthName "nagios" # Require valid-user # -