Impossible to access cgi with non admin user

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.
Locked
sirio81
Posts: 4
Joined: Thu Jun 14, 2012 4:53 am

Impossible to access cgi with non admin user

Post by sirio81 »

Hi, I'm running nagios 3.0.6 on debian lenny.
I created an account called "usertest"

Code: Select all

htpasswd /etc/nagios3/htpasswd.users usertest
And added a contact with the same name

Code: Select all

define contact{
        contact_name                    usertest
        alias                           usertest
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,u,r
        service_notification_commands   notify-service-by-sms
        host_notification_commands      notify-host-by-email
        email                           [email protected]
        pager                           123455678
}
If I access nagios from the lan, I can log in with nagiosadmin and usertest without problem.
http://192.168.2.250/nagios3
If I access nagios from Internet, I can log in only with nagiosadmin!
http://<mypublicip>/nagios3

I can't figure out the reason.

This is apache config:

Code: Select all

grep -v '#' /etc/apache2/conf.d/nagios3.conf | less

ScriptAlias /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3
ScriptAlias /nagios3/cgi-bin /usr/lib/cgi-bin/nagios3

Alias /nagios3/stylesheets /etc/nagios3/stylesheets

Alias /nagios3 /usr/share/nagios3/htdocs

<DirectoryMatch (/usr/share/nagios3/htdocs|/usr/lib/cgi-bin/nagios3)>
        Options FollowSymLinks

        DirectoryIndex index.html

        AllowOverride AuthConfig
        Order Allow,Deny
        Allow From All

        AuthName "Nagios Access"
        AuthType Basic
        AuthUserFile /etc/nagios3/htpasswd.users
        require valid-user
</DirectoryMatch>
What do you thing about that?
Is there any log I can look at?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Impossible to access cgi with non admin user

Post by lmiltchev »

Besides that apache config file, do you have any other configs that may be relevant in this case, for example in "/etc/httpd/conf.d/"? Anything interesting in apache error log?
Be sure to check out our Knowledgebase for helpful articles and solutions!
sirio81
Posts: 4
Joined: Thu Jun 14, 2012 4:53 am

Re: Impossible to access cgi with non admin user

Post by sirio81 »

Nothing in /var/log/apache2/error.log.
I attache the full apache configuration.
Let me know if you see somenting particular.
Attachments
apache2.conf.gz
(18.77 KiB) Downloaded 373 times
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Impossible to access cgi with non admin user

Post by agriffin »

It may have something to do with /etc/apache2/conf.d/nagios3.conf, but that wasn't included in the tarball you uploaded since it's a symlink on your system (I can see the filename but it has a size of 0).
sirio81
Posts: 4
Joined: Thu Jun 14, 2012 4:53 am

Re: Impossible to access cgi with non admin user

Post by sirio81 »

You are right, it's a symlink

Code: Select all

ls -l /etc/apache2/conf.d/nagios3.conf
lrwxrwxrwx 1 root root 25  6 apr  2009 /etc/apache2/conf.d/nagios3.conf -> /etc/nagios3/apache2.conf
That file is the one of the first post.
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Impossible to access cgi with non admin user

Post by agriffin »

Ah, you're right. Compared with my Apache configuration for Nagios, the only differences I noticed were that I had "AllowOverride None" and "Options None". Try changing your AllowOverride value and see if that helps.
sirio81
Posts: 4
Joined: Thu Jun 14, 2012 4:53 am

Re: Impossible to access cgi with non admin user

Post by sirio81 »

Unfortunatly it didn't help.
Thank you anyway.
Locked