首页 > 代码库 > nagios在apache加载信息
nagios在apache加载信息
基本安装完成,现在配置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
本文出自 “11736718” 博客,请务必保留此出处http://11746718.blog.51cto.com/11736718/1876240
nagios在apache加载信息