Page 3 of 4

Re: Authentication problem

Posted: Thu Jun 05, 2014 2:48 am
by hellb0y77
</virtualhost> instead </VirtualHost> is a transcription error, in the nagios.conf file is </VirtualHost>
I have modified www.mydomain.it/nagios in nagios.mydomain.it and works, but don't ask user e password and appear "Logged in as ?", when click to host and services "It appears as though you do not have permission to view information for any of the services you requested..."

Same error....

Re: Authentication problem

Posted: Thu Jun 05, 2014 2:06 pm
by sreinhardt
If you didn't have to login, apache would be unable to pass a user variable to the cgi's. Is this the only virtual host defined for port 80 on your system? Do you still have a separate htaccess file, or has that been entirely removed? Sorry if I missed that one, just want to be 100% sure we are on the same page. Otherwise your nagios.cfg for apache looks great!

Re: Authentication problem

Posted: Fri Jun 06, 2014 1:05 am
by hellb0y77
Not have .htaccess file in nagios directory and only one domain in registered in port 80

Re: Authentication problem

Posted: Fri Jun 06, 2014 10:46 am
by scottwilkerson
Can we see the current nagios.conf

Re: Authentication problem

Posted: Fri Jun 06, 2014 11:07 am
by hellb0y77

Code: Select all

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName  nagios.mydomain.it
    ServerAlias nagios.mydomain.it
    DocumentRoot /usr/local/nagios/share
    ErrorLog /var/log/httpd/error_nagios.log

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>

</VirtualHost>

Re: Authentication problem

Posted: Fri Jun 06, 2014 2:21 pm
by scottwilkerson
and you are accessing this host via http://nagios.mydomain.it/nagios/ correct? Not via IP...

Re: Authentication problem

Posted: Fri Jun 06, 2014 2:49 pm
by hellb0y77
yes, nagios.mydomain.it or nagios.mydomain.it/nagios not ip, is a virtual host

Re: Authentication problem

Posted: Mon Jun 09, 2014 3:24 pm
by tmcdonald
This is getting stranger and stranger. I hate to sound like we're passing you off, but have you posted about this on one of the Apache support forums?

http://www.apachelounge.com/
http://www.webmasterworld.com/apache/

We're happy to keep trying here, but you honestly might have better luck in a forum dedicated to Apache where they would know these configs inside and out.

Re: Authentication problem

Posted: Mon Jun 09, 2014 3:35 pm
by eloyd
I'm looking at your Apache httpd.conf and your nagios.conf and they both look okay to me, but I see one line that I don't like. It's not wrong, I just wonder if it might be causing problem.

Whatever your main IP address is ("ifconfig" will show you), then change this line:

Code: Select all

NameVirtualHost *:80
To this line:

Code: Select all

NameVirtualHost IPADDRESS:80
But replace IPADDRESS with your real IPADDRESS. It shouldn't matter, but I just want to remove variables. I would also like to see the output of the command (as root):

Code: Select all

httpd -V
httpd -l
All that being said, I think you're getting way out of Nagios land here as @tmcdonald said. If you can't get it working, I'd say spin up a new EC2 instance, do a yum upgrade, and then install Nagios from source again. It really isn't hard to get it working.

Re: Authentication problem

Posted: Tue Jun 10, 2014 2:16 am
by hellb0y77
httpd -V

Code: Select all

Server version: Apache/2.2.15 (Unix)
Server built:   Feb  7 2012 09:50:11
Server's Module Magic Number: 20051115:24
Server loaded:  APR 1.3.9, APR-Util 1.3.9
Compiled using: APR 1.3.9, APR-Util 1.3.9
Architecture:   64-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="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"
httpd -l

Code: Select all

Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c
ifconfig show the private IP, i enter the private IP or public?