Nagios before installation, Nagios needs PHP support after 3.1.x, so it is necessary to install PHP and HTTP-related support here.
First, create Nagios users and Groups
[Root@test2 ~]# useradd-s/sbin/nologin Nagios
[Root@test2 ~]# Mkdir/usr/local/nagios
[Root@test2 ~]# chown-r nagios.nagios/usr/local/nagios/
Two, HTTP and PHP installation configuration
(1) HTTP Installation
[Root@test2 ~]# tar zxvf httpd-2.2.11.tar.gz
[Root@test2 ~]# CD httpd-2.2.11
[Root@test2 httpd-2.2.11]#./configure--prefix=/usr/local/apache2--enable-so
[Root@test2 httpd-2.2.11]# make && make install
[Root@test2 ~]#/usr/local/apache2/bin/apachectl start
(2) PHP installation
[Root@test2 ~]# yum install-y libpng libpng-devel libjpeg libjpeg-devel freetype freetype-devel gd gd-devel mysql-devel Libxml2-devel LIBXML2
[Root@test2 ~]# mkdir/usr/local/php
[Root@test2 ~]# CD php-5.2.9
[Root@test2 php-5.2.9]# Yum install-y libxml2-devel
[Root@test2 php-5.2.9]#./configure--prefix=/usr/local/php/--with-apxs2=/usr/local/apache2/bin/apxs
[Root@test2 php-5.2.9]# make && make install
(3) Configure PHP and HTTP
Modify configuration file [Root@test2 ~]# vim/usr/local/apache2/conf/httpd.conf
User Nagios
Group Nagios
AddType application/x-httpd-php. php
<ifmodule dir_module>
DirectoryIndex index.php index.html
</IfModule>
Third, install Nagios
(1) Installation Nagios
[Root@test2 ~]# tar zxvf nagios-3.2.0.tar.gz
[Root@test2 ~]# CD nagios-3.2.0
[Root@test2 nagios-3.2.0]#./configure--prefix=/usr/local/nagios/
[Root@test2 nagios-3.2.0]# make all
[Root@test2 nagios-3.2.0]# make install
[Root@test2 nagios-3.2.0]# make install-init generate boot script
/usr/bin/install-c-M 755-d-o root-g root/etc/rc.d/init.d
/usr/bin/install-c-M 755-o root-g root Daemon-init/etc/rc.d/init.d/nagios
Init Script Installed * * *
[Root@test2 nagios-3.2.0]# make Install-commandmode Modify Permissions
/usr/bin/install-c-M 775-o nagios-g nagios-d/USR/LOCAL/NAGIOS//VAR/RW
chmod G+S/USR/LOCAL/NAGIOS//VAR/RW
External Command Directory configured * * *
[Root@test2 nagios-3.2.0]# make install-config generate configuration file
/usr/bin/install-c-M 775-o nagios-g nagios-d/usr/local/nagios//etc
(2) Installation of Nagios Plug-ins
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/soft/tools/
[Root@test2 ~]# tar zxvf nagios-plugins-1.4.9.tar.gz
[Root@test2 ~]# CD nagios-plugins-1.4.9
[Root@test2 nagios-plugins-1.4.9]#./configure--prefix=/usr/local/nagios/
[Root@test2 nagios-plugins-1.4.9]# make && make install
(3) The installation of Chinese cultural plug-ins
Note: The Chinese software here is consistent with the Nagios version, otherwise there will be problems
[Root@test2 ~]# tar jxvf nagios-cn-3.2.0.tar.bz2
[Root@test2 ~]# CD nagios-cn-3.2.0
[Root@test2 nagios-cn-3.2.0]#./configure--prefix=/usr/local/nagios/
[Root@test2 nagios-cn-3.2.0]# make all
[Root@test2 nagios-cn-3.2.0]# make install && make Install-init && make Install-commandmode && Make Install-config && make install-webconf
(4) Configure secure HTTP Nagios
[Root@test2 ~]# cd/usr/local/apache2/conf/httpd.conf
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 execcgi
allowoverride None
order Allow,deny
allow to all
AuthName "Nagios Ac Cess "
authuserfile/usr/local/nagios/etc/htpasswd
Require valid-user
</directory
[Root@test2 ~]#/usr/local/apache2/bin/htpasswd-c/usr/local/nagios/etc/htpasswd Chenzhongyang
New Password:
Re-type New Password:
Adding password for user Chenzhongyang
Four, the wrong line
First, starting Nagios:this account be currently not available Nagios start an error
Modify the Nagios shell if the following prompts appear
Starting Nagios:this account is currently not available.
# Service Nagios Restart
Running configuration Check...done.
Stopping Nagios:done.
Starting Nagios:this account is currently not available.
Done.
Workaround:
Modify/ETC/PASSWD
Change the/sbin/nologin into/bin/bash