This article is mainly for the installation of source code, please note.
First step: Pre-Installation preparation, first install the required dependency package (yum-y install gcc glibc glibc-common gd gd-devel)
Step two: Install Apache source code, (./configure--prefix=/usr/local/apache2; Make and make install), install Apr if prompted for a missing APR, and then specify the installation path for APR when installing Apache (--WITH-APR=/USR/LOCAL/APR).
The second part: Install PHP source code, (./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs), This step is to add PHP-supported modules to the Apache modules directory. then make; Make install
Step three: Prepare to install Nagios (add user useradd nagios;passwd Nagios).
Fourth step: Start installing Nagios
(1)./configure--with-command-group=nagcmd
(2) Make All;make install;make install-config;make install-commandmode;make install-webconf
(3) Htpasswd-c/usr/local/nagios/etc/htpasswd.users nagiosadmin (this user is your credentials to log in to Nagios)
Fifth step: Need to include in Apache config file (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>
#作用: The path and CGI path used to log in to Nagios
)
Note: (You will need to add AddType application/x-httpd-php. php in Apache; index.php after index.html;
The goal is to enable Apache to support PHP)
Note: (In addition, the user and group in Apache are changed to Nagios)
Sixth Step: Install Nagios-plugins
./configure--with-nagios-user=nagios--with-nagios-group=nagios; make; Make install
The installation is now almost there. Restart Apache and Nagios; enter Http://your Server/nagios in the browser;
Enter your username and password to be OK.
This article is from the Linux shell blog, so be sure to keep this source http://madaqiang.blog.51cto.com/7955196/1559277
Installation Nagios details and precautions