[omd-commits] OMD Git: omd: nagios: Apache rewrite rules for handling the local-hierarchy

git version control git at mathias-kettner.de
Thu Dec 16 13:56:09 CET 2010


Module: omd
Branch: master
Commit: 4d2a70949460458c43afab1198d284755621caeb
URL:    http://omdistro.org/projects/omd/repository/revisions/4d2a70949460458c43afab1198d284755621caeb

Author: Joerg Linge <pitchfork at pnp4nagios.org>
Date:   Thu Dec 16 13:55:48 2010 +0100

nagios: Apache rewrite rules for handling the local-hierarchy

---

 packages/nagios/skel/etc/nagios/apache.conf        |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/packages/nagios/skel/etc/nagios/apache.conf b/packages/nagios/skel/etc/nagios/apache.conf
index 0d3ff6d..fc89f4f 100644
--- a/packages/nagios/skel/etc/nagios/apache.conf
+++ b/packages/nagios/skel/etc/nagios/apache.conf
@@ -1,5 +1,13 @@
 # Apache configuration for access to Nagios web GUI
 
+# Handle locally installed files via the internal URI /noc/check_mk/local
+# These are files stored below local/share/check_mk/web/htdocs
+Alias /###SITE###/nagios/local ###ROOT###/local/share/nagios/htdocs
+<Directory ###ROOT###/local/share/nagios/htdocs>
+      Order deny,allow
+      allow from all
+</Directory>
+
 ScriptAlias /###SITE###/nagios/cgi-bin ###ROOT###/lib/nagios/cgi-bin
 <Directory ###ROOT###/lib/nagios/cgi-bin>
   Order allow,deny
@@ -11,4 +19,11 @@ Alias /###SITE###/nagios ###ROOT###/share/nagios/htdocs
 <Directory ###ROOT###/share/nagios/htdocs>
   Order allow,deny
   Allow from all
+  # Rewrite rules for handling the local-hierarchy. All URI to static
+  # files are redirected, if those exist in local/. Thus the user
+  # even can override shipped static files.
+  RewriteEngine on
+  RewriteCond "###ROOT###/local/share/nagios/htdocs/$1" "-f"
+  RewriteRule "(.*)" "/###SITE###/nagios/local/$1"
+
 </Directory>
diff --git a/packages/nagios/skel/local/share/nagios/htdocs/.gitignore b/packages/nagios/skel/local/share/nagios/htdocs/.gitignore
new file mode 100644
index 0000000..e69de29



More information about the omd-commits mailing list