Chinaunix首页 | 论坛 | 博客
  • 博客访问: 92364
  • 博文数量: 30
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 92
  • 用 户 组: 普通用户
  • 注册时间: 2013-10-10 16:25
个人简介

Linux综合群 248806132)欢迎大婶常驻,欢迎菜鸟入户...喜欢linux的都来坐坐

文章分类
文章存档

2015年(1)

2014年(7)

2013年(22)

我的朋友

分类: 系统运维

2014-11-19 22:54:28

我是使用centos6.5配置的,
一、创建apache目录验证文件,使用的apache是源码包安装./configure --prefix=/usr/local/apache
安装nagios的时候make install-webconf ,当要cat /etc/httpd/conf.d/nagios.conf >> /usr/local/apache/conf/httpd.conf就要注意了,
cat /etc/httpd/conf.d/nagios.conf
   AuthUserFile /usr/local/nagios//etc/htpasswd.users
   AuthUserFile /usr/local/nagios//etc/htpasswd.users
文档里面的这两句话决定你后面使用/usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users这时候,有些文档是
/usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/htpasswd的,而到时打开网页的错误

二、当你成功的安装完NAGIOS的时候;有些教程会教你重启apache跟nagios;这是要注意
你编译安装在/usr/local/apache的Apache重启是要在/usr/local/apache/bin/apachectl restart
如果你用了apachectl restart、这时候可能就会出现You don't have permission to access /nagios/ on this server.
应为直接apachectl restart是调用/etc/httpd/conf/httpd.conf的apache配置文档。

编译安装Nagios;而在make install那几步,我还用make install-webconf了,然后在后期要导入/usr/local/apache/conf/httpd.conf的时候,我直接把/etc/httpd/conf.d/nagios.conf加进去了;在一些教程上加了被注释的文字的范例,也坑了我一脸,同时也觉得挺方便的。

nagios在nagios3.1.x版本以后,配置web监控界面时需要php的支持。



编译apache;我是直接./configure --prefix=/usr/local/apache2 --with-included-apr预防不测,待到深入了解时,可以做选择安装与否。
编译PHP;这样./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs   貌似会报错的。提示configure: error: xml2-config not found. Please check your libxml2 installation.
yum install -y libxml2
yum install -y libxml2-devel

在安装Php的时候

# tar zxvf php-5.4.10.tar.gz

# cd php-5.4.10

# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs

出现configure error:libxml2-config not found

就yum install -y libxml2-devel然后继续

# make && make install


还有个错误,重启了虚拟机之后,
/usr/local/apache/bin/apachectl start
service nagios start
会出现80端口被APACHE占用,待解决

登陆之后这里还有个错误的。
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI and check the authorization options in your CGI configuration file.
表示你的登陆进去的用户,没有权限在WEB下看到控件的内容,需要在CGI上的相关权限加入你的用户

唔,差点就把大致过程也弄了一遍了,还是嫌麻烦了,还是分享些许细节就好了。
http://blog.chinaunix.net/uid-29703091-id-4437081.html
这个也是安装的nagios 所出现的问题,这样分享不知道会不会被骂。哈哈

可能会想用到的命令
cat /etc/group
chown -R nagios:nagios nagios
ps -aux | grep 80
netstat -ano | grep 80
netstat -anp | grep 80



啊咧!2014年11月26日 18:05:26果断分享一张成功图。。小心情略鸡冻啊

阅读(2087) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~