| 1 | # Load setenv module (as there is no template in |
| 2 | # /etc/lighttpd/conf-available and it's not loaded by default) |
| 3 | server.modules += ( "mod_setenv" ) |
| 4 | |
| 5 | # Aliases for needed directories |
| 6 | alias.url += ( |
| 7 | "/cgi-bin/icinga" => "/usr/lib/cgi-bin/icinga", |
| 8 | "/icinga/stylesheets" => "/etc/icinga/stylesheets", |
| 9 | "/icinga" => "/usr/share/icinga/htdocs", |
| 10 | ) |
| 11 | |
| 12 | # Enable cgi for /cgi-bin/icinga |
| 13 | $HTTP["url"] =~ "^/cgi-bin/icinga" { |
| 14 | dir-listing.activate = "disable" |
| 15 | cgi.assign = ( ".cgi" => "" ) |
| 16 | } |
| 17 | |
| 18 | # Enable authentication for /icinga and /cgi-bin/icinga |
| 19 | $HTTP["url"] =~ "^/(cgi-bin/)?icinga/" { |
| 20 | auth.backend = "htpasswd" |
| 21 | auth.backend.htpasswd.userfile = "/etc/icinga/htpasswd.users" |
| 22 | auth.require += ( "" => |
| 23 | ( |
| 24 | "method" => "basic", |
| 25 | "realm" => "Icinga Access", |
| 26 | "require" => "valid-user" |
| 27 | ) |
| 28 | ) |
| 29 | } |
waja / gist:f5565a764f1c4ba59adb87364d3ce9c0
Last active 3 months ago