Solved

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

Posted on 2004-09-03
8
537 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
  • 5
  • 3
8 Comments
 
LVL 15

Accepted Solution

by:
samri earned 500 total points
Comment Utility
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
Comment Utility
nice... that may be it..

i will try it in 5 mins
0
 

Author Comment

by:jibranilyas
Comment Utility
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
 

Author Comment

by:jibranilyas
Comment Utility
got it ... i changed the permissions already...
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 15

Expert Comment

by:samri
Comment Utility
do a "chmod 777 .htaccess"
0
 
LVL 15

Expert Comment

by:samri
Comment Utility
"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
Comment Utility
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
Comment Utility
thanks everyone... i figured it out

nagios is finally working :-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now