基本安装完成,现在配置apache,让它可以用web界面访问
vim /usr/local/apache2/conf/httpd.conf
#添加一行
Include conf/extra/nagios.conf
#修改主和组
User nagios
Group nagios
然后创建nagios.conf文件
vim /usr/local/apache2/conf/extra/nagios.conf
#添加内容
#setting for nagios
ScriptAlias /nagios/cgi-bin/"/usr/local/nagios/sbin/"
#注意/usr/local/nagios/sbin/和/usr/local/nagios/sbin的区别
<Directory"/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>
Alias /nagios "/usr/local/nagios/share/"
<Directory"/usr/local/nagios/share/">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>
/usr/local/apache2/bin/htpasswd -c/usr/local/nagios/etc/htpasswd nagiosadmin #创建一个用户,用于后台访问nagios
/usr/local/apache2/bin/apachectl start
/etc/init.d/nagios start
http://192.168.134.141/nagios/ #通过ip访问nagios
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。