# nagios / apache - permission problem

## Joseph_sys

I'm following standard "nagios" installation but I'm running into some permission problem.

I've followed standard installation procedure: 

http://www.gentoo.org/doc/en/nagios-guide.xml

But  I could not even login with password, so I transfered the authentication method from file:

/etc/nagios/auth.users

to:

/etc/apache2/users

and it worked, I can login but it seems to me the problem might be with my apache.

Nagios can not read any file in /etc/nagios directory.  When I click on host  (in nagios) I get: 

```
Error: Could not open CGI config file '/etc/nagios/cgi.cfg' for reading!
```

I have cgi.cfg files installed with correct permission: 

```
modules.d/99_nagios3.conf 

<IfDefine NAGIOS>

   ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi-bin/

   <Directory "/usr/lib/nagios/cgi-bin/">

      AllowOverride AuthConfig

      Options ExecCGI

      Order allow,deny

      Allow from 127.0.0.1

   </Directory>

   Alias /nagios /usr/share/nagios/htdocs

   <Directory "/usr/share/nagios/htdocs">

      AllowOverride AuthConfig

      Order allow,deny

      Allow from 127.0.0.1

   </Directory>

</IfDefine>
```

```
ll /usr/lib/nagios/cgi-bin/

total 3292

-rwxr-xr-x 1 root root 238088 Nov 22 19:52 avail.cgi

-rwxr-xr-x 1 root root 238712 Nov 22 19:52 cmd.cgi

-rwxr-xr-x 1 root root 209336 Nov 22 19:52 config.cgi

-rwxr-xr-x 1 root root 254440 Nov 22 19:52 extinfo.cgi

...
```

So why apache can not read /etc/nagios/ directory?

My apache modules.d/00_default_settings.conf 

```
...

<Directory />

   Options FollowSymLinks

   AllowOverride None

   Order deny,allow

   Deny from all

</Directory>

# added below

<Directory "/var/www/localhost/htdocs">

        AllowOverride All

        Order allow,deny

        Allow from all

</Directory>

...
```

but the above is not it. As I change the permission to 

<Directory />

	Options FollowSymLinks

	AllowOverride All

	Order allow,deny

	Allow from all

</Directory>

and it did not help.

----------

## Joseph_sys

Solved.

I think it is a bug in Gentoo nagios setup. Directory /etc/nagios should have a permission 775

```
drwxrwxr-x  3 nagios   nagios     4096 Nov 22 20:11 nagios
```

----------

