Page 1 of 2
Nagios Installation - URL not found
Posted: Fri Oct 12, 2012 9:09 am
by silverspirit
Hi,
I recently installed Nagios Core on a SuSe Linux system incl. Apache.
The Apache testpage is visible when connecting from a remote site to /<server_name>/
Accessing Nagios is not possible using /<server_name>/nagios (The requested URL /nagios was not found on this server.)
I assume if the apache test webpage is visible there is no firewall restriction at all, so the nagios page should be visible ? (the server is using not the standard firewall, so I first would need to take a look at the manuals for this specific firewall)
The apache log is saying:
160.50.3.130 - - [12/Oct/2012:15:43:07 +0200] "GET /nagios HTTP/1.1" 404 204
The nagios log shows:
[1350045462] SERVICE ALERT: localhost;HTTP;CRITICAL;SOFT;2;Connection refused
[1350045522] SERVICE ALERT: localhost;HTTP;CRITICAL;SOFT;3;Connection refused
Thanks
silverspirit
Re: Nagios Installation - URL not found
Posted: Fri Oct 12, 2012 9:36 am
by slansing
Have you cracked open your Apache server's access logs? I believe for suse they are located here:
Re: Nagios Installation - URL not found
Posted: Fri Oct 12, 2012 10:12 am
by silverspirit
No, actually its about a SLES server, the access_log is located here
/usr/local/apache2/logs
Re: Nagios Installation - URL not found
Posted: Fri Oct 12, 2012 11:02 am
by slansing
Oh sorry I must need more coffee, have you taken a look at the access_log? can you post it here?
Re: Nagios Installation - URL not found
Posted: Mon Oct 15, 2012 3:44 am
by silverspirit
find attached the complete apache2 access log file.
the connectivity tests were done at around 12/Oct/2012:14:29:08
I am also not sure what the other regular messages mean (error 200 45)
Thanks
Re: Nagios Installation - URL not found
Posted: Mon Oct 15, 2012 7:38 am
by scottwilkerson
Did you add an apache conf that points to the nagios directory?
Re: Nagios Installation - URL not found
Posted: Mon Oct 15, 2012 8:30 am
by silverspirit
In the meantime I figured out, the 404 error was caused by a missing Alias in httpd.conf
Now I am getting 403 errors I'll try to fix.
I am wondering why this isn't part of the installation procedure...
Re: Nagios Installation - URL not found
Posted: Mon Oct 15, 2012 9:59 am
by silverspirit
I am getting confused again, still struggeling with 403 (permission denied) error, not sure what to do next, hopefully someone can point me to the right direction.
I have added the following lines to apache config file httpd.conf:
Code: Select all
#document root alias
Alias /nagios /usr/local/nagios/share
<Directory /usr/local/nagios>
Order allow,deny
Allow from all
</Directory>
In the directory section I have tried both /usr/local/nagios/share (folder where eg index.php is located) and also /usr/local/nagios
In the logs I can see the following:
error_log
Code: Select all
[Mon Oct 15 16:43:04.981158 2012] [authz_core:error] [pid 14647:tid 140009560459024] [client 160.50.3.130:1459] AH0
1630: client denied by server configuration: /usr/local/nagios/share/index.php
[Mon Oct 15 16:43:12.199881 2012] [authz_core:error] [pid 14644:tid 140009501710096] [client 160.50.3.130:1460] AH0
1630: client denied by server configuration: /usr/local/nagios/share
access log
Code: Select all
160.50.3.130 - - [15/Oct/2012:16:43:04 +0200] "GET /nagios/index.php HTTP/1.1" 403 218
160.50.3.130 - - [15/Oct/2012:16:43:12 +0200] "GET /nagios HTTP/1.1" 403 208
Further for testing I have disabled (uncommented) the restrictions in the main Directory setting:
Code: Select all
<Directory />
# AllowOverride none
# Require all denied
</Directory>
and now I was able to get at least the left frame of the page, but it wasn't shown properly. I also used the URL //<server_hostname>/nagios/index.php
Code: Select all
160.50.3.130 - - [15/Oct/2012:16:50:58 +0200] "GET /nagios HTTP/1.1" 301 233
160.50.3.130 - - [15/Oct/2012:16:50:58 +0200] "GET /nagios/ HTTP/1.1" 403 209
160.50.3.130 - - [15/Oct/2012:16:51:06 +0200] "GET /nagios/%3C?php%20echo%20$corewindow;?> HTTP/1.1" 404 209
[Mon Oct 15 16:50:58.338970 2012] [autoindex:error] [pid 17004:tid 140009577244432] [client 160.50.3.130:1492] AH01
276: Cannot serve directory /usr/local/nagios/share/: No matching DirectoryIndex (index.html) found, and server-gen
erated directory index forbidden by Options directive
I am also wondering why I didn't got the nagios login popup window yet
Any help is appreaciated.
Re: Nagios Installation - URL not found
Posted: Mon Oct 15, 2012 12:18 pm
by mguthrie
I hate to ask, but is PHP installed on this system?
Your nagios.conf file should look something like this (this is from a source install):
Code: Select all
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 Core"
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 Core"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
Re: Nagios Installation - URL not found
Posted: Tue Oct 16, 2012 6:16 am
by silverspirit
mh, PHP is not installed currently. I tried to install it before without success, later I was reading the Nagios openSUSE core Quickinstall guide where php was not included as required package. (in difference to the fedore guide) This seems to be wrong. 3 steps back
