Solved

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

Posted on 2004-09-03
8
540 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
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

785 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