Nagios cgi-bin error

frank ratty at they.org
Sat May 27 01:59:25 CEST 2006


You do not have "Indexes" enabled for your cgi-bin directory, that's why 
you can't browse it. This is a good thing.

Also, the whole point of defining a ScriptAlias directory is that the 
webserver will attempt to _execute_ all the files that are called from 
that location. Not just display, _execute_. Your txt file probably does 
not have an interpreter line (#!/bin/bash or something similar) and it's 
not a binary executable, so even tho your execute bits are set you get a 
500 error.

And finally, does the "/var/run/nagios/" directory exist? If not then the 
file "/var/run/nagios/nagios.pid" is not likely to be written.
If the directory does exist, is it writable by the nagios user or nagios 
group?

-f

On Sat, 27 May 2006, atstake atstake wrote:

> Date: Sat, 27 May 2006 09:22:09 +1000
> From: atstake atstake <atstake at gmail.com>
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Nagios cgi-bin error
> 
> I am running Nagios version 2.0b4 with Apache 1.3.29 on OpenBSD 3.8.
>
> Everytime I try to go to my http://website/nagios/cgi-bin it gives error -
>
> Error 403
> Forbidden
> You don't have permission to access /nagios/cgi-bin/ on this server
>
> However, http://website/nagios/ works fine!
>
> Apache access_log shows -
>
> nagiosadmin [26/May/2006:19:46:33 +1000] "GET /nagios/cgi-bin/this
> .txt HTTP/1.1" 403 293
>
> Apache error_log shows -
>
> [Fri May 26 19:46:33 2006] [error] [client 203.13.45.66] file
> permissions deny server execution: /myserver/nagios/cgi-bin/this.txt
>
> Directory permission for "/var/www/mysite/nagios/cgi-bin" directory
> looks like this -
>
> drwxr-xr-x 2 root daemon 512 May 26 16:51 /nagios/cgi-bin/
>
> File permissions on "/var/www/mysite/nagios/cgi-bin" directory looks like 
> this -
>
> -rw-r--r-- 1 root daemon 73 May 26 16:51 .nagios_passwd
> -r-xr-xr-x 1 root bin 240064 Sep 4 2005 avail.cgi
> -r-xr-xr-x 1 root bin 241600 Sep 4 2005 cmd.cgi
> -r-xr-xr-x 1 root bin 202848 Sep 4 2005 config.cgi
> -rw-r--r-- 1 root daemon 4 May 26 16:49 this.txt
>
> Note: "this.txt" is a file I created.
>
> Here's my nagios part of httpd.conf
>
> ScriptAlias /nagios/cgi-bin /var/www/mysite/nagios/cgi-bin
> <Directory "/var/www/mysite/nagios/cgi-bin/">
> Options ExecCGI
> AllowOverride AuthConfig
> Order allow,deny
> Allow from all
> AuthName "Nagios Access"
> AuthType Basic
> AuthUserFile /var/www/mysite/nagios/cgi-bin/.nagios_passwd
> Require user nagiosadmin
> </Directory>
>
>
> Alias /nagios /var/www/mysite/nagios
> <Directory "/var/www/mysite/nagios/">
> Options -Indexes
> Order deny,allow
> Deny from all
> Allow from <my IP>
> AuthType Basic
> AuthName "Nagios"
> AuthUserFile /var/www/mysite/nagios/.nagios_passwd
> Require user nagiosadmin
> </Directory>
>
> I changed the permisson of the file "this.txt" to 755 & it gives
> "Internal Server Error" if I want to view that file. For all the other
> files (CGIs) it still gives the Permission Denied error.
>
> my /etc/nagios directory is a symlink to /var/www/etc/nagios
>
> I did a /usr/local/sbin/nagios -v /etc/nagios/nagios.cfg & it works
> fine - shell exit code is 0.
>
> Then I tried to start Nagios (/usr/local/sbin/nagios -d
> /etc/nagios/nagios.cfg) & its shell exit code gives error -
>
> in /var/log/messages I can see
>
> /var/run/nagios/nagios.pid does not exist (ENOENT)
> Bailing out due to errors encountered while attempting to daemonize...
> (PID=12744)
>
> I have a user called _nagios in /etc/passwd.
>
>
> -------------------------------------------------------
> All the advantages of Linux Managed Hosting--Without the Cost and Risk!
> Fully trained technicians. The highest number of Red Hat certifications in
> the hosting industry. Fanatical Support. Click to learn more
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting 
> any issue. ::: Messages without supporting info will risk being sent to 
> /dev/null
>


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list