码迷,mamicode.com
首页 > 移动开发 > 详细

nagios安装部署

时间:2015-01-06 15:46:40      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:nagios安装部署

  1. nagios服务端安装

    基础套件  rpm -q gcc glibc glibc-common gd gd-devel xinetd openssl-devel

    创建用户 

    useradd -r nagios

    mkdir /usr/local/nagios

    chown -R nagios.nagios /usr/local/nagios

    安装nagios  

    ./configure --prefix=/usr/local/nagios

    make all

    make install

    make install-init

    make install-commandmode

    make install-config

    添加nagios服务

    chkconfig --add nagios

    chkconfig --level 35 nagios

    安装nagios-plugins 

    ./configure --prefix=/usr/local/nagios

    make && make install


  2. http和php安装

    apache用的是httpd-2.4.10.tar.gz

    还需要apr-1.5.1.tar.gz和apr-util-1.5.4.tar.gz

    tar xf httpd-2.2.23.tar.gz

    tar xf apr-1.5.1.tar.gz

    tar xf apr-util-1.5.4.tar.gz

    cp -r /home/apr-1.5.1 srclib/apr

    cp -r apr-util-1.5.4 httpd-2.4.10/srclib/apr-util

    cd httpd-2.2.23

    ./configure --prefix=/usr/local/httpd --with-included-apr

    make && make install

    php安装

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

    httpd.conf配置修改

    添加AddType application/x-httpd-php .php

    安装完成修改httpd.conf

    DirectoryIndex index.html 改成 DirectoryIndex index.php index.html



    开启cgi模块 LoadModule cgid_module modules/mod_cgid.so

                AddHandler cgi-script .cgi

    末尾添加

    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
         Order allow,deny
         Allow from all
         AuthName "nagios Access"
         AuthUserFile /usr/local/nagios/etc/htpasswd
         Require valid-user

    保存退出

    创建apache目录验证文件

    /usr/local/apache2/bin/htpasswd -c /usr/local/nagios/etc/htpasswd admin

    访问http://localhost/nagios 即可看到nagios的web界面





    

本文出自 “第一遍” 博客,转载请与作者联系!

nagios安装部署

标签:nagios安装部署

原文地址:http://4620226.blog.51cto.com/4610226/1599722

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!