温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

编译安装nagios

发布时间:2020-06-11 12:42:17 来源:网络 阅读:466 作者:Goovi 栏目:移动开发

#安装nagios

useradd -s /sbin/nologin nagios

mkdir /usr/local/nagios

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

tar zxvf nagios.tar.gz

cd nagios

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

make all

make install

make install-init

make install-commandmode

make install-config

#安装nagios插件

tar zxvf nagios-plugins.tar.gz

cd nagios-plusing

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

make

make install

#安装apapche

tar zxvf httpd.tar.gz

cd httpd

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

make

make install

#安装php

yum --disablerepo=\* --enablerepo=c5-media -y install libxml2-devel

tar zxvf php.tar.gz

cd php

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

make 

make install

#修改apache配置文件

User nagios

Group nagios

DirectoryIndex index.html index.php

AddType application/x-httpd-php .php

 

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

</Directory> 

 

#创建认证文件

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

//创建一个nagios的用户

 

#启动相关服务

service nagios start

/usr/local/apache2/bin/apachectl start

 

#访问管理页面

http://ip/nagios

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI