Page 1 of 1

Nagios 403 error

Posted: Tue May 10, 2011 4:56 pm
by LMW
I have nagios + nginx running on Debian Lenny box. I've updated from nagios in Lenny repos to nagios in Squeeze repos. Everything was working before that. Now, when I try to access nagios on http://myserver/nagios3 I'm allowed to enter credentials, but after that I'm constantly getting "403 Forbidden" error.
nginx logs show: directory index of "/usr/share/nagios3/htdocs/" is forbidden, client: x.x.x.x, server: nagios3, request: "GET /nagios3/ HTTP/1.1", host: "x.x.x.x"
All permissions seem to be set OK. What could be a problem?

Re: Nagios 403 error

Posted: Wed May 11, 2011 9:21 am
by tonyyarusso
Did you update nginx as well as nagios? It could be that it's not set to recognize index.php as a possible index file anymore.

Re: Nagios 403 error

Posted: Wed May 11, 2011 10:06 am
by LMW
tonyyarusso wrote:Did you update nginx as well as nagios? It could be that it's not set to recognize index.php as a possible index file anymore.
Thank you for reply. No, I didn't update nginx (it's 0.8.54 now), because we've got a bunch of php-heavy web-sites and I didn't think that could be a case. I will do that later today. Any other suggestions?

Re: Nagios 403 error

Posted: Wed May 11, 2011 11:27 am
by tonyyarusso
Apparently squeeze's version of PHP should include FPM internally - could that change be affecting your setup?

Re: Nagios 403 error

Posted: Wed May 11, 2011 12:14 pm
by LMW
tonyyarusso wrote:Apparently squeeze's version of PHP should include FPM internally - could that change be affecting your setup?
Well, I don't know that for sure. My task is just to setup nagios for several servers while Nagios' server part have to be placed on that particular server. But I've updated PHP while updating Nagios to Squeeze version. So it's a new version now.

Re: Nagios 403 error

Posted: Wed May 11, 2011 12:18 pm
by tonyyarusso
I've only done this with Apache, so I'm afraid I might not be much further help here.

Re: Nagios 403 error

Posted: Wed May 11, 2011 1:08 pm
by LMW
tonyyarusso wrote:I've only done this with Apache, so I'm afraid I might not be much further help here.
I'm thinking of putting Nagios on Apache server. I don't think that will have any impact on nginx web-server and web-sites it's hosting. What do you think about that?

Re: Nagios 403 error

Posted: Wed May 11, 2011 4:14 pm
by tonyyarusso
As long as they're listening on different ports.

Re: Nagios 403 error

Posted: Wed May 11, 2011 8:56 pm
by LMW
OK, a little update. I've been reading through Internet and found out, that "403 error" usually occurs when nginx can't properly read password file (that is possible when password in such file is not properly encrypted).

And one more strange thing. When I've changed the path to password file

from:

Code: Select all

"auth_basic_user_file /etc/nagios3/conf.d/htpasswd;"


to:

Code: Select all

"auth_basic_user_file /etc/nagios3/htpasswd.users;"
"Login loop" started (of course I've created that new "htpasswd.users" file before that). I can't authorize at all! I've tried to generate password using Apache's htpasswd util, but with no success. Can anyone shed more light on that?

Re: Nagios 403 error

Posted: Thu May 12, 2011 11:07 am
by LMW
Thanks everybody for help. This issue was solved by moving "root" and "index" directives from "location" part to global. Now it's working as intended.