Issues With Nagvis Authentication
Posted: Wed Nov 20, 2019 5:33 am
Hello,
Recently I have upgraded our nagios instance from Centos 6 to Centos 7.
I am having trouble with Nagvis, originally it came up with the PHP authentication (PHP_AUTH_USER) error and I followed the instructions to allow automatic authentication.
Unable to authenticate user. The environment variable PHP_AUTH_USER is not set or empty.
Commented out these lines in nagvis.conf
#AuthName "NagVis Access"
#AuthType Basic
#AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
#Require valid-user
added these lines under </Directory>
RewriteEngine on
RewriteLock var/log/rewrite.lck
RewriteLog /dev/null
RewriteLogLevel 0
RewriteRule /nagvis/ - [E=REMOTE_USER:nagiosadmin]
Commented this line nagvis.ini.php
;logonenvvar="PHP_AUTH_USER"
Now I can't start the httpd service, I get this error
â— httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2019-11-20 20:28:59 AEST; 2min 47s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 55163 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 55162 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 55162 (code=exited, status=1/FAILURE)
Nov 20 20:28:59 nagios.metrotraffic.seq.its systemd[1]: Starting The Apache HTTP Server...
Nov 20 20:28:59 nagios.metrotraffic.seq.its httpd[55162]: AH00526: Syntax error on line 41 of /etc/httpd/conf.d/nagvis.conf:
Nov 20 20:28:59 nagios.metrotraffic.seq.its httpd[55162]: Invalid command 'RewriteLock', perhaps misspelled or defined by a module not included in the server...iguration
Nov 20 20:28:59 nagios.metrotraffic.seq.its systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Nov 20 20:28:59 nagios.metrotraffic.seq.its kill[55163]: kill: cannot find process ""
Nov 20 20:28:59 nagios.metrotraffic.seq.its systemd[1]: httpd.service: control process exited, code=exited status=1
Nov 20 20:28:59 nagios.metrotraffic.seq.its systemd[1]: Failed to start The Apache HTTP Server.
Nov 20 20:28:59 nagios.metrotraffic.seq.its systemd[1]: Unit httpd.service entered failed state.
Nov 20 20:28:59 nagios.metrotraffic.seq.its systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
Recently I have upgraded our nagios instance from Centos 6 to Centos 7.
I am having trouble with Nagvis, originally it came up with the PHP authentication (PHP_AUTH_USER) error and I followed the instructions to allow automatic authentication.
Unable to authenticate user. The environment variable PHP_AUTH_USER is not set or empty.
Commented out these lines in nagvis.conf
#AuthName "NagVis Access"
#AuthType Basic
#AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
#Require valid-user
added these lines under </Directory>
RewriteEngine on
RewriteLock var/log/rewrite.lck
RewriteLog /dev/null
RewriteLogLevel 0
RewriteRule /nagvis/ - [E=REMOTE_USER:nagiosadmin]
Commented this line nagvis.ini.php
;logonenvvar="PHP_AUTH_USER"
Now I can't start the httpd service, I get this error
â— httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2019-11-20 20:28:59 AEST; 2min 47s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 55163 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 55162 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 55162 (code=exited, status=1/FAILURE)
Nov 20 20:28:59 nagios.metrotraffic.seq.its systemd[1]: Starting The Apache HTTP Server...
Nov 20 20:28:59 nagios.metrotraffic.seq.its httpd[55162]: AH00526: Syntax error on line 41 of /etc/httpd/conf.d/nagvis.conf:
Nov 20 20:28:59 nagios.metrotraffic.seq.its httpd[55162]: Invalid command 'RewriteLock', perhaps misspelled or defined by a module not included in the server...iguration
Nov 20 20:28:59 nagios.metrotraffic.seq.its systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Nov 20 20:28:59 nagios.metrotraffic.seq.its kill[55163]: kill: cannot find process ""
Nov 20 20:28:59 nagios.metrotraffic.seq.its systemd[1]: httpd.service: control process exited, code=exited status=1
Nov 20 20:28:59 nagios.metrotraffic.seq.its systemd[1]: Failed to start The Apache HTTP Server.
Nov 20 20:28:59 nagios.metrotraffic.seq.its systemd[1]: Unit httpd.service entered failed state.
Nov 20 20:28:59 nagios.metrotraffic.seq.its systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.