Page 1 of 2

Nagios web interface not available on Cpanel server

Posted: Sat Feb 14, 2015 7:57 pm
by jasgot
I have a new install of Nagios Core and it appears to be running, but I cannot access the web interface from my location.

The install is on my dedicated server at a hosting center running:
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
with WHM/Cpanel

Nagios is installed in:
/usr/local/nagios

The Nagios subdomain is nagios.xxx.com or xxx.com/nagios

SELinux is disabled:
[root@server ~]# sestatus
SELinux status: disabled
[root@server ~]# getenforce
Disabled
[root@server ~]#

The Vhost section of my httpd.conf is:
<VirtualHost 1.2.3.4:80>
ServerName nagios.xxx.com
ServerAlias http://www.nagios.xxx.com
DocumentRoot /sites/xxx/public_html/nagios
ServerAdmin [email protected]
UseCanonicalName On
CustomLog /usr/local/apache/domlogs/nagios.xxx.com combined
CustomLog /usr/local/apache/domlogs/nagios.sxxxyo.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User xxx# Needed for Cpanel::ApacheConf
UserDir disabled
UserDir enabled xxx
<IfModule mod_suphp.c>
suPHP_UserGroup nagios nagios
</IfModule>
<IfModule concurrent_php.c>
php4_admin_value open_basedir "/sites/xxx:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
php5_admin_value open_basedir "/sites/xxx:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
<IfModule !concurrent_php.c>
<IfModule mod_php4.c>
php_admin_value open_basedir "/sites/xxx:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir "/sites/xxx:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
<IfModule sapi_apache2.c>
php_admin_value open_basedir "/sites/xxx:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
</IfModule>
</IfModule>
<IfModule !mod_disable_suexec.c>
<IfModule !mod_ruid2.c>
SuexecUserGroup nagios nagios
</IfModule>
</IfModule>
<IfModule mod_ruid2.c>
RMode config
RUidGid nagios nagios
</IfModule>
<IfModule itk.c>
# For more information on MPM ITK, please read:
# http://mpm-itk.sesse.net/
AssignUserID xxx xxx
</IfModule>

ScriptAlias /cgi-bin/ /sites/xxx/public_html/nagios/cgi-bin/

Include "/usr/local/apache/conf/userdata/std/2/xxx/nagios.xxx.com/*.conf"
</VirtualHost>




My /usr/local/apache/conf/userdata/std/2/xxx/nagios.xxx.com/*.conf file is called nagios.conf and its contents are:
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
Options ExecCGI
AllowOverride AuthConfig
Order allow,deny
#Allow from 10.0.0.0/24
</Directory>

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

<Directory "/usr/local/nagios/share">
Options None
AllowOverride AuthConfig
Order allow,deny
#Allow from 10.0.0.0/24
</Directory>



I find that when I check to see if nagios is running with "service nagios status" it is not running,
When I start it, it does run. Maybe it stops when I restart httpd?


I've spent hours and hours on this and cannot find the problem.

Thanks for any assistance you can provide.

Re: Nagios web interface not available on Cpanel server

Posted: Sun Feb 15, 2015 1:46 pm
by jasgot
Here the Apache log entries I see:
[Sat Feb 14 20:05:57 2015] [error] [client 68.84.164.49] File does not exist: /sites/xxx/public_html/nagios/nagios
[Sat Feb 14 20:05:57 2015] [error] [client 68.84.164.49] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Re: Nagios web interface not available on Cpanel server

Posted: Sun Feb 15, 2015 10:32 pm
by Box293
Did you follow a guide to install Core? Can you provide a link to it?

What version of Core?

Re: Nagios web interface not available on Cpanel server

Posted: Mon Feb 16, 2015 10:01 am
by jasgot
Box293 wrote:Did you follow a guide to install Core? Can you provide a link to it?

What version of Core?
I followed this guide, but while troubleshooting, I strayed away from some of the settings. But I did get them all put back.
http://kmaiti.blogspot.com/2010/09/how- ... el-or.html

Nagios 4.0.8

Thanks.

Re: Nagios web interface not available on Cpanel server

Posted: Mon Feb 16, 2015 12:33 pm
by abrist
It looks like you ahve 2 script aliases pointing to 2 different locations for the nagios cgi-bin directory:

Code: Select all

ScriptAlias /cgi-bin/ /sites/xxx/public_html/nagios/cgi-bin/
And:

Code: Select all

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
Judging by the error:

Code: Select all

File does not exist: /sites/xxx/public_html/nagios/nagios
I would guess apache is using the first definition.

In which location did you install the cgi files to?

Re: Nagios web interface not available on Cpanel server

Posted: Mon Feb 16, 2015 1:08 pm
by jasgot
In which location did you install the cgi files to?
Nagios is actually in /usr/local/nagios/

cgi files are in:
/usr/local/nagios/sbin

Re: Nagios web interface not available on Cpanel server

Posted: Mon Feb 16, 2015 1:11 pm
by jasgot
Should the nagios.conf that is read as an include override the httpd.conf file?

Re: Nagios web interface not available on Cpanel server

Posted: Mon Feb 16, 2015 5:49 pm
by scottwilkerson
No, it is a config fragment. But your httpd.conf should be including files from the conf.d directory it is placed in /etc/httpd/conf.d.

Re: Nagios web interface not available on Cpanel server

Posted: Mon Feb 16, 2015 5:51 pm
by tgriep
Could you run these commands and post back the output

Code: Select all

grep conf.d /etc/httpd/conf/httpd.conf
grep ServerRoot /etc/httpd/conf/httpd.conf

Re: Nagios web interface not available on Cpanel server

Posted: Mon Feb 16, 2015 5:58 pm
by jasgot
tgriep wrote:Could you run these commands and post back the output

Code: Select all

grep conf.d /etc/httpd/conf/httpd.conf
grep ServerRoot /etc/httpd/conf/httpd.conf

Code: Select all

[root@sabrina ~]# grep conf.d /etc/httpd/conf/httpd.conf
#       /usr/local/cpanel/bin/apache_conf_distiller --update                                                    #
#   For detailed instructions on using Include files and the apache_conf_distiller with the new configuration   #
#  The only template updated by the apache_conf_distiller is main.default.                                      #
#       /usr/local/cpanel/bin/apache_conf_distiller --update                                                    #
#   For detailed instructions on using Include files and the apache_conf_distiller with the new configuration   #
#  The only template updated by the apache_conf_distiller is main.default.                                      #
[root@sabrina ~]#
Your second grep returned nothing.