# Nagios Installation Help!



## tech-it-^ (Aug 18, 2006)

Hey,

I am new to Nagios, and Linux as well. I am trying to do an installation but I'm coming up with nothing. I am following the step by step guide given in the book "Apress Pro Nagios 2.0 By James Turnbull." Yes, an old version of Nagios, but I thought it would work. I'm trying to just do a quick install and followed everything in the book verbatim just about with no errors. Until I tested the Web interface and it doesn't work. I did the install on a Suse 11.1 box. Here's what I did:

Installed Dependecies via Yast2:
installed C compiler
installed Apache2
installed gd lib's

Nagios install process:
unzipped source package
cd nagios-3*
groupadd nagios
useradd -g nagios -M nagios (as told in the book)

Then created/added command group to appropriate users:
groupadd ncmd
usermod -G ncmd nagios
usermod -G ncmd wwwrun

compileing Nagios:
./configure --prefix=/usr/local/nagios --with-htmlurl=/nagios/ --with-cgiurl=/nagios/cgi-bin --with-nagios-user=nagios --with-nagios-group=nagios --with-command-group=ncmd

then installed binaries, CGI, and HTML files etc...:
make install && make install-init
make install-commandmode
ls -al /usr/local/nagios/var/rw
make install-config

then the plugins after unzipping:
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios --with-cgiurl=/nagios/cgi-bin

install binaries, CGI, etc...
make
make install

THEN, after all that is done I have to config the web interface like so by editing the httpd.conf file. I found this file here: /etc/apache2/httpd.conf . IS this right? There isn't an apache folder in /usr/local/apache and no directory for httpd here: /etc/httpd/conf* There is no httpd.conf or directory just the one I mentioned. Here's what I modified the script. I JUST ADDED TO IT I DIDN'T MODIFIY THE INITIAL CONTENTS. I dont know if this is right, but I tried to also delete the initial configuration with the Directory directive and used the one in the book. Here is what it tole me to add to the httpd.conf file:

ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
<Directory "/usr/local/nagios/sbin">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

Alias /nagios/ /usr/local/nagios/share
<Directory "/usr/local/nagios/share">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

do I delete the other stuff before this this stuff:

<Directory>
AllowOverride None
Options None
Order deny,allow
Deny from all
</Directory>

Ok, after doing so I restarted apache2 service and as for Nagios. I type "service nagios start" and I get this: Starting nagios:su: warning: cannot change directory to /home/nagios: No such file or directory

it seems like its trying to get at the nagios user and the home directory that I didn't create for it because the BOOK told me not to. Anyway, I manually start it by this:
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

It shows up under process when I type ps -A as nagios. So idk what to do. I need help. I read through the forums and google... With no avail. This book lied to me. OR i'm doing somthing stupid. I try to get to my web interface by typing in the url:http://localhost/nagios/ and get Access forbidden! You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

I then tried to uninstall Nagios and reinstall but use the online docs instead of the book. The same thing happens. Here's my Apache configuration:

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

I have the nagiosadmin created and password set and I am prompted when I try to access the site. The error log is as follows:

[Mon Aug 17 14:50:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 14:55:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 15:00:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 15:05:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 15:10:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 15:15:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 15:20:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 15:23:40 2009] [notice] caught SIGTERM, shutting down
[Tue Aug 18 06:33:52 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Aug 18 06:33:53 2009] [notice] Apache/2.2.10 (Linux/SUSE) mod_ssl/2.2.10 OpenSSL/0.9.8h configured-- resuming normal operations
[Tue Aug 18 06:35:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 06:40:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 06:45:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 06:50:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 06:55:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 07:00:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 07:05:03 2009] [error] [client 127.0.0.2] Directory index forbidden by Options directive: /usr/local/nagios/share/
[Tue Aug 18 07:05:03 2009] [error] [client 127.0.0.2] File does not exist: /srv/www/htdocs/favicon.ico
[Tue Aug 18 07:05:06 2009] [error] [client 127.0.0.2] File does not exist: /srv/www/htdocs/favicon.ico
[Tue Aug 18 07:05:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 07:10:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/


Then I looked where my Apache server config file was and this is what I got:

httpd2 -V
Server version: Apache/2.2.10 (Linux/SUSE)
Server built: Dec 3 2008 10:04:51
Server's Module Magic Number: 20051115:18
Server loaded: APR 1.3.3, APR-Util 1.3.4
Compiled using: APR 1.3.3, APR-Util 1.3.4
Architecture: 32-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/srv/www"
-D SUEXEC_BIN="/usr/sbin/suexec2"
-D DEFAULT_PIDLOG="/var/run/httpd2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/run/accept.lock"
-D DEFAULT_ERRORLOG="/var/log/apache2/error_log"
-D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"

So removed my nagios.conf file and replaced it in the location where you see SERVER_CONFIG_FILE="/etc/apache2/httpd.conf" I just copied all contents in that file and put it here (in httpd.conf file)... I now get this message after logging into the apache server:

Forbidden

You don't have permission to access /nagios/ on this server.

the error log shows this entry:
Directory index forbidden by Options directive: /usr/local/nagios/share/

Any suggestions? I thought the install was the easy part and the configuration was the hard part... Sorry for the long long post... Much appreciated. Thanks


----------



## tech-it-^ (Aug 18, 2006)

bump*


----------



## wmorri (May 29, 2008)

Hi,

I would have a look at this site. It should help you with setting up the program.

Cheers!


----------



## tech-it-^ (Aug 18, 2006)

Thanks, will I have to install apache? Or is that automatically installed on SLES 10 SP1. It doesn't list it as a prerequisite to install. It just has these:

gd-devel
libpng-devel


----------



## wmorri (May 29, 2008)

Hi,

You can install apache is can't hurt, there are a lot of uses for apache.


----------



## tech-it-^ (Aug 18, 2006)

Its just that I had different issues when installing from rpm and from source. Which would you recommend?


----------



## wmorri (May 29, 2008)

It isn't really going to matter which one you use. It is all up to you.


----------



## tech-it-^ (Aug 18, 2006)

Well, in the past I had issues with which directory certain things installed to (which sometimes affected the make install-webconf command). I'll follow the guidlines given in the tutorial. I'll just do an rpm for apache and it looks like source for nagios. I'll keep you posted. Thanks


----------

