Solved

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

Posted on 2004-09-03
8
543 Views
Last Modified: 2008-03-10

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."

 
0
Comment
Question by:jibranilyas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 15

Accepted Solution

by:
samri earned 500 total points
ID: 11975382
deleting the file may cause more trouble to nagios.

Edit the .htaccess file, and try adding "Satisfy Any" at the end of file.
http://httpd.apache.org/docs-2.0/mod/core.html#satisfy

More stuff on how authentication and authorization is implemented on Apache : http://httpd.apache.org/docs-2.0/howto/auth.html

cheers.
0
 

Author Comment

by:jibranilyas
ID: 11975422
nice... that may be it..

i will try it in 5 mins
0
 

Author Comment

by:jibranilyas
ID: 11975796
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~
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jibranilyas
ID: 11975868
got it ... i changed the permissions already...
0
 
LVL 15

Expert Comment

by:samri
ID: 11975922
do a "chmod 777 .htaccess"
0
 
LVL 15

Expert Comment

by:samri
ID: 11975929
"chmod 755 .htaccess" should be fine.  apache process should be able to read this file.  And remember the .htpasswd too.
0
 

Author Comment

by:jibranilyas
ID: 11976195
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
0
 

Author Comment

by:jibranilyas
ID: 11977141
thanks everyone... i figured it out

nagios is finally working :-)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question