#
# Rewrite old /nagios/ references to new generic location
RewriteEngine on
RewriteRule "^/nagios(.*)" "/wleiden/nagios$1" [R,L]
RewriteRule "^/nagiosgraph(.*)" "/wleiden/nagiosgraph$1" [R,L]
RewriteRule "^/pnp(.*)" "/wleiden/pnp$1" [R,L]
#
# Ensure PHP is enabled for CGI purposes
SetHandler php5-script
DirectoryIndex index.php
#
# Access is allowed by username/password OR specific location
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/etc/nagios/htpasswd.users
Require ip 83.162.206.202/32
Require ip 192.168.178.0/24
Require valid-user
#
# Force REMOTE_USER for automatic logins. Avoids requirement of passwords for
# specific IP ranges.
SetEnv REMOTE_USER nagiosadmin
#
# PNP4Nagios
Alias /wleiden/nagios/pnp "/usr/local/www/pnp/"
# Turn on URL rewriting
RewriteEngine On
Options symLinksIfOwnerMatch
# Installation directory
RewriteBase /wleiden/nagios/pnp/
# Protect application and system files from being viewed
RewriteRule "^(?:application|modules|system)/" - [F]
# Allow any files or directories that exist to be displayed directly
RewriteCond "%{REQUEST_FILENAME}" !-f
RewriteCond "%{REQUEST_FILENAME}" !-d
# Rewrite all other URLs to index.php/URL
RewriteRule "^.*$" "index.php/$0" [PT]
#
# Nagios
ScriptAlias /wleiden/nagios/cgi-bin/ "/usr/local/www/nagios/cgi-bin/"
Alias /wleiden/nagios "/usr/local/www/nagios/"
Options ExecCGI