LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Nagios 3.1.2 + RHEL 5.3 You don't have permission to access /nagios/ on this server (https://www.linuxquestions.org/questions/linux-server-73/nagios-3-1-2-rhel-5-3-you-dont-have-permission-to-access-nagios-on-this-server-738536/)

psix 07-08-2009 03:42 AM

Nagios 3.1.2 + RHEL 5.3 You don't have permission to access /nagios/ on this server
 
Hi i install nagios on server using this manual:


http://nagios.sourceforge.net/docs/3...rt-fedora.html

but when i log in to nagios i see error:

You don't have permission to access /nagios/ on this server


i search internet but nothing find, please help.

[nagios]# ll
total 24
drwxrwxr-x 2 nagios nagios 4096 Jul 8 11:03 bin
drwxrwxr-x 3 nagios nagios 4096 Jul 8 11:03 etc
drwxrwxr-x 2 nagios nagios 4096 Jul 8 10:07 libexec
drwxrwxr-x 2 nagios nagios 4096 Jul 8 11:03 sbin
drwxrwxr-x 10 nagios nagios 4096 Jul 8 11:03 share
drwxrwxr-x 5 nagios nagios 4096 Jul 8 11:39 var

[nagios]# cat /etc/group | grep apache
apache:x:48:
nagcmd:x:501:nagios,apache


THX!

gael 07-08-2009 04:00 AM

Quote:

Originally Posted by psix (Post 3600607)
but when i log in to nagios i see error:

You don't have permission to access /nagios/ on this server

Hi psix,

What do you mean you do not have permission to access nagios?
Is it on a web interface? Is it in the logs?

Assuming it is on the web interface, you have to allow apache to access /nagios/.

Here is the kind of definition you have to put in the Apache definition for nagios. I know that I have defined one in /etc/nagios2 then asked apache to read the file.

Code:

# Where the HTML pages live
Alias /nagios2 /usr/share/nagios2/htdocs

<DirectoryMatch (/usr/share/nagios2/htdocs|/usr/lib/cgi-bin/nagios2)>
        Options FollowSymLinks

        DirectoryIndex index.html

        AllowOverride AuthConfig
        Order Allow,Deny
        Allow From All

        AuthName "Nagios Access"
        AuthType Basic
        AuthUserFile /etc/nagios2/htpasswd.users
        # nagios 1.x:
        #AuthUserFile /etc/nagios/htpasswd.users
        require valid-user
</DirectoryMatch>

HTH

If you have any other question pls let us know!

G.

psix 07-08-2009 04:12 AM

Hi, i have no access to web interface , when i use iexplore http://server/nagios , and logon, i see :

Forbidden
You don't have permission to access /nagios/ on this server.


--------------------------------------------------------------------------------

Apache/2.2.3 (Red Hat) Server at sak-monitor02 Port 80


I have file nagios.conf in /etc/httpd/conf.d:

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

gael 07-08-2009 04:15 AM

Did you restart / reload apache?

Did you check the logs for nagios and apache?

psix 07-08-2009 04:50 AM

hi, yes i restart reload apache , in apache log i see :


[Wed Jul 08 11:29:15 2009] [error] [client 10.180.65.100] Directory index forbidden by Options directive: /usr/local/nagios/share/

gael 07-08-2009 05:03 AM

Ok try to change the Options value to:

Code:

Options FollowSymLinks
And add the following:

Code:

DirectoryIndex index.html

psix 07-08-2009 05:26 AM

steel

Forbidden
You don't have permission to access /nagios/ on this server.


--------------------------------------------------------------------------------

Apache/2.2.3 (Red Hat) Server at sak-monitor02 Port 80

gael 07-08-2009 05:46 AM

Can you paste, using the "["CODE] "["/CODE] your apache configuration for nagios?
Are you sure you have an include from the main apache configuration file to the nagios configuration file?

Please let me know

Gael

psix 07-08-2009 06:08 AM

I post this code:

I have file nagios.conf in /etc/httpd/conf.d:

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>




In main /etc/httpd/conf/httpd.conf i have no enteris fo nagios.

gael 07-08-2009 10:01 AM

do you know if the nagios file is loaded by apache?

A line which looks like the following:
Code:

Include /etc/apache2/sites-enabled/
Or if you do not know, you can do the following as root:

Code:

cd /etc/httpd/
grep -rH 'Include' *

thx
G.

tatoosh 07-12-2009 06:46 AM

I have the same permission problem with nagios 3.1.2.

Here is my output of your advise:
Code:

[root@tcentos ~]# cd /etc/httpd/
[root@tcentos httpd]# grep -rH 'Include' *
conf/httpd.conf:Include conf.d/*.conf
conf/httpd.conf:#  Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
conf/httpd.conf:#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
conf/httpd.conf:# (You will also need to add "Includes" to the "Options" directive.)
conf/httpd.conf:        Options IncludesNoExec
conf/httpd.conf:        AddOutputFilter Includes html
Binary file modules/mod_include.so matches
grep: run/cups/cups.sock: No such device or address
grep: run/avahi-daemon/socket: No such device or address

can u give me some tipps?


here is my httpd error log:
Quote:

access to /nagios/ failed, reason: verification of user id 'nagiosadmin' not configured
^^ how to configure it ?
lol. i solved the issue:

just installed php and everythink works fine :=)
for my centos:
Quote:

yum install php -y

anthr6x 11-24-2009 02:19 PM

hi guys,
met with the exact same problem.

problem was in http.conf. DirectoryIndex was set to index.html. nagios uses an index.php file. so i have change one virtual host to be 'DirectoryIndex index.php index.html'. works perfectly fine, while the other virtual hosts gives me the 'You don't have permission to access /nagios/ on this server.'

hope that helps ;)

KinnowGrower 05-14-2011 06:26 AM

Yes it was PHP issue
 
Installed php

Restarted Apache
Restarted nagios

Done

Excellent

Thanks for help

Majed17 08-04-2015 02:25 AM

in my case i am on gentoo, what solved it is adding:
Code:

-D NAGIOS -D PHP5
in APACHE2_OPTS=
in /etc/conf.d/apache2


All times are GMT -5. The time now is 05:13 PM.