Page 1 of 1

Impossible to access cgi with non admin user

Posted: Thu Jun 14, 2012 5:03 am
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?

Re: Impossible to access cgi with non admin user

Posted: Thu Jun 14, 2012 10:32 am
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?

Re: Impossible to access cgi with non admin user

Posted: Tue Jun 19, 2012 3:09 am
by sirio81
Nothing in /var/log/apache2/error.log.
I attache the full apache configuration.
Let me know if you see somenting particular.

Re: Impossible to access cgi with non admin user

Posted: Tue Jun 19, 2012 4:02 pm
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).

Re: Impossible to access cgi with non admin user

Posted: Wed Jun 20, 2012 2:57 am
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.

Re: Impossible to access cgi with non admin user

Posted: Wed Jun 20, 2012 10:09 am
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.

Re: Impossible to access cgi with non admin user

Posted: Thu Jun 21, 2012 1:51 am
by sirio81
Unfortunatly it didn't help.
Thank you anyway.