LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Nagios Login Error (https://www.linuxquestions.org/questions/linux-software-2/nagios-login-error-447865/)

sbhupati 05-23-2006 05:29 PM

Nagios Login Error
 
When trying to access the nagios apache web I am getting a forbidden error "You don't have pernmission to access /nagios on this server". The appache error log has the error "Permission denied: access to /nagios failed because search permissions are missing on a component of the path"..

Apache: 1.3.36
Nagios: 2.3.1

I have added both ScriptAlias and Alias to the httpd.conf file and restarted the web server.

ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/

<Directory "/usr/local/nagios/sbin">
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

Alias /nagios /usr/local/nagios/share/
<Directory "/usr/local/nagios/share">
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>

I changed the permission on /usr/local/nagios/sbin and share to 777.

I used htpasswd to add the users. .htaccess file exists in sbin and share directories with 644 permissions. Entries in .htaccess are below:

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
require valid-user

Can somebody please help me.

Thanks in advance

zaichik 05-24-2006 10:02 AM

All the directories in the path "/usr/local/nagios/share" need read and execute permissions for the Apache user (usually "apache" or "nobody").

Get rid of the 777 permissions--you are asking for trouble when you make a directory world-writable. They only need to have read and execute permissions for the Apache user, nothing more. I don't think that the Apache user needs permissions to /usr/local/nagios/sbin--that should only be accessible to the nagios process, IIRC.

Try that and see what the result is.

sbhupati 05-24-2006 10:27 AM

Hello,

Thank you for your feedback.

Yes, I agree with you on the 777 permissions. I just assgined this for my testing. I changed the permissions on /usr/local/nagios/share to 755. But still no luck.

sbhupati 05-24-2006 10:54 AM

I figured out the problem. The root nagios directory does not have the correct permissions. I changed it and it's all hunky dory now.

Thank you

sbhupati 05-24-2006 06:01 PM

You know what it's not really Hunky Dory:(

I am able to login to Nagios. But when I tried to access the cgi-url stuff it is throwing an error:

Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster
Error 404

The apache error_log has the following error:
[Wed May 24 15:54:01 2006] [error] [client 172.22.71.228] script not found or unable to stat: /var/www/cgi-bin/nagios, referer: http://zph38.corp.google.com/nagios/side.html

Any help would be greatly appreciated.

Thank you

zaichik 05-25-2006 07:22 AM

The error is pretty clear from the log: /var/www/cgi-bin/nagios either does not exist or cannot be accessed. It looks to me like either your ScriptAlias or your server-wide DocumentRoot needs to be adjusted.

What is the URL you use to access Nagios?

sbhupati 05-25-2006 11:06 AM

The url is http://zph38.corp.google.com/nagios/

Here is my script alias:

ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/
<Directory "/usr/local/nagios/sbin">
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all
</Directory>


My DocumentRoot is pointing to "/var/www/html"

zaichik 05-26-2006 10:49 AM

Hmm. So, if "http://zph38.corp.google.com" = "/var/www/html", then "http://zph38.corp.google.com/nagios" is looking for "/var/www/html/nagios".

What are the contents of /var/www/html/nagios?

sbhupati 06-01-2006 06:21 PM

I got it fixed for real this time:-)

Thank you for looking into this.


All times are GMT -5. The time now is 09:44 AM.