安裝元件:Yum –y instsll httpd gcc glibc glibc-common* gd* php php-mysql mysql mysql-server
添加使用者與組:
useradd nagios
groupadd nagios
useradd –G nagios nagios
安裝nagios:
Tar zxvf nagios-3.2.1.tar.gz
Cd nagios-3.2.1
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios
Make all
make install
Make install-init
Make install-commmode
Make-install-config
Make install-webconf
vi /usr/local/apache2/conf/httpd.conf
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
<Directory "/usr/local/nagios/sbin">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
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">
Options None
/usr/local/apahce/bin/apachectl restart //重新開機apache
本文轉自zsaisai 51CTO部落格,原文連結:http://blog.51cto.com/3402313/916679