Authentication problem

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
hellb0y77
Posts: 18
Joined: Wed May 28, 2014 3:14 am

Re: Authentication problem

Post 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....
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Authentication problem

Post 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!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
hellb0y77
Posts: 18
Joined: Wed May 28, 2014 3:14 am

Re: Authentication problem

Post by hellb0y77 »

Not have .htaccess file in nagios directory and only one domain in registered in port 80
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Authentication problem

Post by scottwilkerson »

Can we see the current nagios.conf
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
hellb0y77
Posts: 18
Joined: Wed May 28, 2014 3:14 am

Re: Authentication problem

Post 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>
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Authentication problem

Post by scottwilkerson »

and you are accessing this host via http://nagios.mydomain.it/nagios/ correct? Not via IP...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
hellb0y77
Posts: 18
Joined: Wed May 28, 2014 3:14 am

Re: Authentication problem

Post by hellb0y77 »

yes, nagios.mydomain.it or nagios.mydomain.it/nagios not ip, is a virtual host
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Authentication problem

Post 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.
Former Nagios employee
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Authentication problem

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
hellb0y77
Posts: 18
Joined: Wed May 28, 2014 3:14 am

Re: Authentication problem

Post 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?
Locked