Page 1 of 2
Nagiosgraph Access Forbidden
Posted: Mon Jul 21, 2014 7:49 am
by tariqondego
Just installed nagiosgraph but i am getting this error:
Code: Select all
Forbidden
You don't have permission to access /nagiosgraph/cgi-bin/show.cgi on this server.
Apache/2.4.7 (Ubuntu) Server at 192.168.253.59 Port 80
Please advise
Re: Nagiosgraph Access Forbidden
Posted: Mon Jul 21, 2014 4:54 pm
by tmcdonald
Can you show us the permissions on the show.cgi file on your Nagios server?
Code: Select all
ls -l /path/to/nagiosgraph/cgi-bin/show.cgi
Re: Nagiosgraph Access Forbidden
Posted: Mon Jul 21, 2014 5:00 pm
by lmiltchev
Did you configure nagiosgraph with apache?
First configure the web server to run the nagiosgraph CGI scripts. For
example, with Apache do something like this in the Apache configuration:
ScriptAlias /nagiosgraph/cgi-bin /usr/local/nagiosgraph/cgi-bin
<Directory "/usr/local/nagiosgraph/cgi-bin">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /nagiosgraph "/usr/local/nagiosgraph/share"
<Directory "/usr/local/nagiosgraph/share">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Restart the web server:
/etc/init.d/apache2 restart
Re: Nagiosgraph Access Forbidden
Posted: Tue Jul 22, 2014 2:13 am
by tariqondego
Yes i did configure nagiosgraph for apache2:
Code: Select all
# enable nagiosgraph CGI scripts
ScriptAlias /nagiosgraph/cgi-bin "/usr/local/nagiosgraph/cgi"
<Directory "/usr/local/nagiosgraph/cgi">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
# enable nagiosgraph CSS and JavaScript
Alias /nagiosgraph "/usr/local/nagiosgraph/share"
<Directory "/usr/local/nagiosgraph/share">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
The nagiosgraph.conf resides in /etc/apache2/conf-enabled/
The permissions for show.cgi are:
Code: Select all
-rwxr-xr-x 1 root root 5358 Ado 21 10:16 show.cgi
Re: Nagiosgraph Access Forbidden
Posted: Wed Jul 23, 2014 1:17 pm
by lmiltchev
Try changing the following two lines from this:
Code: Select all
ScriptAlias /nagiosgraph/cgi-bin "/usr/local/nagiosgraph/cgi"
<Directory "/usr/local/nagiosgraph/cgi">
to this:
Code: Select all
ScriptAlias /nagiosgraph/cgi-bin "/usr/local/nagiosgraph/cgi-bin"
<Directory "/usr/local/nagiosgraph/cgi-bin">
then restart apache2. Did this fix your issue?
Re: Nagiosgraph Access Forbidden
Posted: Fri Jul 25, 2014 2:45 am
by tariqondego
No,beacuse the 'show.cgi' file is in /usr/local/nagiosgraph/cgi.
There is no 'cgi-bin' folder.
'bin' folder is seperate.
Still getting the same error.
please advise.
Re: Nagiosgraph Access Forbidden
Posted: Fri Jul 25, 2014 1:33 pm
by sreinhardt
What are the permissions of the folders above this?
Code: Select all
ls -ld /usr/local/nagiosgraph/cgi
ls -ld /usr/local/nagiosgraph
Re: Nagiosgraph Access Forbidden
Posted: Thu Aug 14, 2014 3:55 am
by tariqondego
The persmissions are:
Code: Select all
drwxr-xr-x 2 root root 4096 Ado 21 10:16 /usr/local/nagiosgraph/cgi
drwxr-xr-x 10 root root 4096 Ado 21 10:16 /usr/local/nagiosgraph
Please advise.
Re: Nagiosgraph Access Forbidden
Posted: Thu Aug 14, 2014 8:12 pm
by sreinhardt
Well the folder permissions do have other+RX, so technically apache should be able to access at least those folders. Let's have you su into apache, and try to list and execute it.
Code: Select all
su -s /bin/bash apache (if this is ubuntu\debian the user would be apache2)
ls -lart /usr/local/nagiosgraph
ls -lart /usr/local/nagiosgraph/cgi
/usr/local/nagiosgraph/cgi/show.cgi
exit
Re: Nagiosgraph Access Forbidden
Posted: Fri Aug 15, 2014 1:56 am
by tariqondego
Ok,done that and it executes ok.
But from browser its still bringing the 'Forbidden' error.
Please advise.