Link to home
Start Free TrialLog in
Avatar of jibranilyas
jibranilyas

asked on

CAN't access the cgi directory from webserver ....htaccess file --the culprit ???


it seems to me that ever since i have put the .htaccess file in /usr/local/nagios/sbin

i haven't been able to access the cgi-bin dir from the webserver (apache)
i get the permissions error.

HOW do i delete the .htaccess file
the four lines in that .htaccess files are

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


********************************************************************************
   
 Comment from mikebernhardt  feedback
Date: 09/03/2004 09:32AM PDT
 Comment  


What do you mean, how do you delete it? If you're on UNIX, just cd into the directory and type rm .htaccess.

What do you mean about an apache permissions error- permission getting to your pages or permission running apache?

That file appears to be requiring authentication via the file AuthUserFile /usr/local/nagios/etc/htpasswd.users. If you don't have that then you can't authenticate to see the pages.

If you're having problems running apache, then maybe the permissions on your .htaccess file are wrong. It needs to be readable by whatever user owns apache.

********************************************************************************************************
 
Comment from jibranilyas
Date: 09/03/2004 09:47AM PDT
 Your Comment  


ok here are the answers

I am using RedHat 8.0  
i didn't see .htaccess file in /usr/local/nagios/sbin folder.... it may be hidden...   well, i will remove that from the command prompt..

if i use file browser, i can get to that location ( /ur/local/nagios/sbin ) but its not accessible thru the webserver.
in httpd.conf, i have
ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/
<Directory "/usr/local/nagios/sbin/">
    AllowOverride AuthConfig
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>

--
I have full permissions to the path /usr/local/nagios/etc/htpasswd.users.. i have opened the file and read encrypted passwords.


"If you're having problems running apache, then maybe the permissions on your .htaccess file are wrong. It needs to be readable by whatever user owns apache."
THIS may be it
I am logged in under root...
how do i give access of APACHE to root..
there is a user and group line in Apache's httpd.conf file i think.. do i have to edit that?

sorry, i m a newbie in linux ... THANKS for your time.

****************************************************************************************************
 
Comment from jibranilyas
Date: 09/03/2004 09:51AM PDT
 Your Comment  


again, before putting that .htaccess file in the sbin folder, i was able to atleast view the cgi pages..  

ON THOSE CGI PAGES, i got this error
here is the URL ( got it from "copy link location" on the link ) where i got the error
http://localhost/nagios/cgi-bin/status.cgi?hostgroup=all&style=hostdetail

"It appears as though you do not have permission to view information for any of the hosts you requested...
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file."

 
ASKER CERTIFIED SOLUTION
Avatar of samri
samri
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jibranilyas
jibranilyas

ASKER

nice... that may be it..

i will try it in 5 mins
how can i change the permissions of this file so the webserver can reach this file
-rwxrwxr-x  1 nagios nagios 143056 Sep  2 10:19 status.cgi
 
i would like to give full access to .htaccess ...


-rw-------  1 root   root      124 Sep  3 12:58 .htaccess
-rw-------  1 root   root      102 Sep  3 12:51 .htaccess~
got it ... i changed the permissions already...
do a "chmod 777 .htaccess"
"chmod 755 .htaccess" should be fine.  apache process should be able to read this file.  And remember the .htpasswd too.
i did that..  Thanks, now .htpasswd is working i guess , as i was asked by the browser to enter the username and password, i entered one from the htpasswd.users file..

Now, I can access the cgi pages, but it says "It appears as though you do not have permission to view information or any of the services you requested.  THIS PAGE has all nagios headers. but i guess the services mentioned IN those cgi files are not accessible due to the permission problems.. does anyone know what it could be. I did read somewhere about "authenticated contact" and "authenticated user"

Also, where would be .htpasswd

i did create   htpasswd /usr/local/nagios/etc/htpasswd.users <username>

i was thinking the file name would be htpasswd.users...  that has 777 permission btw
thanks everyone... i figured it out

nagios is finally working :-)