您好,登錄后才能下訂單哦!
今天配置安裝完成Nagios后,始終無法登錄,報錯信息如下
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
于是查看先關日志文件,相關報錯日志可以在Apache中查看
vi /var/log/httpd/error_log
或者
vi /usr/localapache/logs/error_log
日志提示是驗證報錯,
nagios could not open password file :/usr/local/nagios/etc/htpasswd
無法打開htpasswd文件,于是進入該目錄查看
cd /usr/local/nagios/etc/htpasswd
原來實際文件為htpasswd.users,漏了users
最后再進入apache中修改httpd.cof文件,在AuthenUserFile 處應填寫地址如下
/usr/local/nagios/etc/htpasswd.users
最后重啟Apache,Nagios,驗證登錄,OK,一點感想,還是老話說的好,小心使得萬年船!
此外提供其他幾個無法登錄的排錯方法:
1.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
默認在root用戶下生成的密碼文件權限是root的,記得修改成用戶nagios的
chown -R nagios.nagios /usr/local/nagios/etc/htpasswd.users
2.修改/etc/selinux/config文件中設置SELINUX=disabled
3.在 httpd.conf 后面 加了驗證的
#setting for nagios ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin" <Directory "/usr/local/nagios/sbin"> AuthType Basic Options ExecCGI AllowOverride None Order allow,deny Allow from all AuthName "Nagios Access" AuthUserFile /usr/local/nagios/etc/htpasswd //用于此目錄訪問身份驗證的文件 Require valid-user </Directory> Alias /nagios "/usr/local/nagios/share" <Directory "/usr/local/nagios/share"> AuthType Basic Options None AllowOverride None AuthName "Nagios Access" AuthUserFile /usr/local/nagios/etc/htpasswd //用于此目錄訪問身份驗證的文件 Require valid-user </Directory> Alias /nagios "/usr/local/nagios/share" <Directory "/usr/local/nagios/share"> AuthType Basic Options None AllowOverride None Order allow,deny Allow from all AuthName "nagios Access" AuthUserFile /usr/local/nagios/etc/htpasswd Require valid-user </Directory>
4.有用 htpasswd 有用htpasswd.users的,Apache默認用的驗證文件是htpasswd.users,用別的文件名需要定義
5./usr/local/nagios/etc/cgi.cfg中user 是否為設置密碼帳號的那個帳號
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。