?
Solved

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

Posted on 2004-09-03
8
Medium Priority
?
548 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 2000 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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

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

Independent Software Vendors: 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!

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

777 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