Hello…
my detail configurations are as follows,I can access the test page for apache,but cannot invoke the nagios!
please help me.
1, creating a directory storing compressed packages with suffix of .tar.gz and bz2(including nagios-2.0b3.tar, nagios-plugins-1.4.tar, gd-2.0.15.tar, httpd-2.0.54.tar.bz2)
[root@localhost local]# mkdir nagiosfolder
2, I have copied the four packages into nagiosfolder
[root@localhost nagiosfolder]# ls
gd-2.0.33.tar.gz nagios-2.0b3.tar.gz
httpd-2.0.54.tar.bz2 nagios-plugins-1.4.tar.gz
3, unpacking gd-2.0.33.tar,gz
[root@localhost nagiosfolder]# tar xzf gd-2.0.33.tar.gz
[root@localhost nagiosfolder]# ls
gd-2.0.33 httpd-2.0.54.tar.bz2 nagios-plugins-1.4.tar.gz
gd-2.0.33.tar.gz nagios-2.0b3.tar.gz
4,installing gd-2.0.33
[root@localhost nagiosfolder]# cd gd-2.0.33
[root@localhost gd-2.0.33]# ./configure
[root@localhost gd-2.0.33]# make
[root@localhost gd-2.0.33]# make install
5, unpacking nagios-2.0b3.tar.gz
[root@localhost gd-2.0.33]# cd …
[root@localhost nagiosfolder]#
[root@localhost nagiosfolder]# tar xzf nagios-2.0b3.tar.gz
[root@localhost nagiosfolder]# ls
gd-2.0.33 httpd-2.0.54.tar.bz2 nagios-2.0b3.tar.gz
gd-2.0.33.tar.gz nagios-2.0b3 nagios-plugins-1.4.tar.gz
6, creat nagios user/group
[root@localhost nagiosfolder]# adduser nagios
7, Creat install directory
[root@localhost /]# mkdir /usr/local/nagios
8, Change the owner of the base installtion directory to be the Nagios user and group you added earlier as follows:
[root@localhost /]# chown nagios.nagios /usr/local/nagios
9,Add group
[root@localhost /]# /usr/sbin/groupadd nagcmd
[root@localhost /]# /usr/sbin/groupadd nagcmd
[root@localhost /]# /usr/sbin/usermod -G nagcmd apache
10,Install apache
[root@localhost nagiosfolder]# ls
gd-2.0.33 httpd-2.0.54.tar.bz2 nagios-2.0b3.tar.gz
gd-2.0.33.tar.gz nagios-2.0b3 nagios-plugins-1.4.tar.gz
11, unpacking httpd-2.0.54.tar.bz2
[root@localhost nagiosfolder]# bunzip2 httpd-2.0.54.tar.bz2
[root@localhost nagiosfolder]# tar xf httpd-2.0.54.tar
[root@localhost nagiosfolder]# ls
gd-2.0.33 httpd-2.0.54.tar nagios-plugins-1.4.tar.gz
gd-2.0.33.tar.gz nagios-2.0b3
httpd-2.0.54 nagios-2.0b3.tar.gz
[root@localhost nagiosfolder]# cd httpd-2.0.54
[root@localhost httpd-2.0.54]# ./configure
[root@localhost httpd-2.0.54]# make
[root@localhost httpd-2.0.54]# make install
12, install nagios
[root@localhost nagiosfolder]# ls
gd-2.0.33 httpd-2.0.54.tar nagios-plugins-1.4.tar.gz
gd-2.0.33.tar.gz nagios-2.0b3
httpd-2.0.54 nagios-2.0b3.tar.gz
[root@localhost nagiosfolder]# cd nagios-2.0b3
Run the configure script
[root@localhost nagios-2.0b3]# ./configure --prefix=/usr/local/nagios --with-cgiurl=/nagios/cgi-bin --with-htmurl=/nagios/ --with-nagios-user=nagios --with-nagios-group=nagios --with-command-group=nagios
Compile Nagios and the CGIs
[root@localhost nagios-2.0b3]# make all
Install the binaries and HTML files
[root@localhost nagios-2.0b3]# make install
Installing an Init Script
[root@localhost nagios-2.0b3]# make install-init
[root@localhost nagios-2.0b3]# make install-commandmode
[root@localhost nagios-2.0b3]# make install-config
Change to nagios directory
[root@localhost nagios]# dir
bin etc sbin share var
13, installing the plugins
[root@localhost nagiosfolder]# ls
gd-2.0.33 httpd-2.0.54.tar nagios-plugins-1.4.tar.gz
gd-2.0.33.tar.gz nagios-2.0b3
httpd-2.0.54 nagios-2.0b3.tar.gz
[root@localhost nagiosfolder]# tar xzf nagios-plugins-1.4.tar.gz
[root@localhost nagiosfolder]# ls
gd-2.0.33 httpd-2.0.54.tar nagios-plugins-1.4
gd-2.0.33.tar.gz nagios-2.0b3 nagios-plugins-1.4.tar
httpd-2.0.54 nagios-2.0b3.tar.gz
[root@localhost nagiosfolder]# cd nagios-plugins-1.4
[root@localhost nagios-plugins-1.4]# ./configure
[root@localhost nagios-plugins-1.4]# make
[root@localhost nagios-plugins-1.4]# make install
14, rename the *.cfg-sample to *cfg
[root@localhost nagios]# ls
bin etc libexec sbin share var
[root@localhost nagios]# cd etc
[root@localhost etc]# ls
bigger.cfg-sample minimal.cfg-sample resource.cfg-sample
cgi.cfg-sample misccommands.cfg-sample
checkcommands.cfg-sample nagios.cfg-sample
[root@localhost etc]# mkdir sample
[root@localhost etc]# cp *.cfg-sample sample/
[root@localhost etc]# ls
bigger.cfg-sample minimal.cfg-sample resource.cfg-sample
cgi.cfg-sample misccommands.cfg-sample sample
checkcommands.cfg-sample nagios.cfg-sample
[root@localhost etc]# mv bigger.cfg-sample bigger.cfg
[root@localhost etc]# mv cgi.cfg-sample cgi.cfg
[root@localhost etc]# mv checkcommands.cfg-sample checkcommands.cfg
[root@localhost etc]# mv minimal.cfg-sample minimal.cfg
[root@localhost etc]# mv misccommands.cfg-sample misccommands.cfg
[root@localhost etc]# mv nagios.cfg-sample nagios.cfg
[root@localhost etc]# mv resource.cfg-sample resource.cfg
[root@localhost etc]# ls
bigger.cfg checkcommands.cfg misccommands.cfg resource.cfg
cgi.cfg minimal.cfg nagios.cfg sample
15, setting up the web interface
[root@localhost local]# cd apache2/
[root@localhost apache2]# cd bin
[root@localhost bin]# apachectl start
[root@localhost apache2]# cd conf
[root@localhost conf]# ls
highperformance.conf httpd.conf magic ssl.conf
highperformance-std.conf httpd-std.conf mime.types ssl-std.conf
add something like the following to your web server httpd.conf
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
<Directory “/usr/local/nagios/sbin”>
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all
Alias /nagios /usr/local/nagios/share
<Directory “/usr/local/nagios/share”>
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all
[root@localhost conf]# vi httpd.conf
:
:
:
ServerAdmin [email protected]
DocumentRoot /www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
#
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
<Directory “/usr/local/nagios/sbin”>
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all
Alias /nagios /usr/local/nagios/share
<Directory “/usr/local/nagios/share”>
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all
:wq ENTER
[root@localhost conf]# /etc/rc.d/init.d/httpd restart
Stopping httpd: OK ]
Starting httpd: OK ]
[root@localhost conf]#
I typed ](http://)/ on another PC connected to linux
then the test page for apache appeared,
And I typed ](http://)/nagios
A error page of