# Nagios problems [unsolved]

## jonfr

I am having problem with Nagios. I can't get it to work and I am not sure what is the issue.

I get this message.

```
Whoops!

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

Here are some things you should check in order to resolve this error:

   1. Make sure you've installed a CGI config file in its proper location. See the error message about for details on where the CGI is expecting to find the configuration file. A sample CGI configuration file (named cgi.cfg) can be found in the sample-config/ subdirectory of the Nagios source code distribution.

   2. Make sure the user your web server is running as has permission to read the CGI config file. 

Make sure you read the documentation on installing and configuring Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at http://www.nagios.org. 
```

I also cannot figure out how to password protect the web interface.   :Question: 

Thanks in advance.

----------

## coutts99

Does /etc/nagios/cgi.cfg exist on your system?

----------

## bbgermany

Hi,

usually the basic web authentication works via htaccess and inside the cgi.cfg file. So if you dont have a working cgi.cfg, you wont get authentication to work as well.

Which nagios version do you use?

bb

----------

## jonfr

 *coutts99 wrote:*   

> Does /etc/nagios/cgi.cfg exist on your system?

 

It is there.

```
 ls /etc/nagios/

cgi.cfg  htpasswd.users  nagios.cfg  objects  resource.cfg

```

I have nagios 3.0.6 installed.

----------

## coutts99

What does

```
 ls -lh /etc/nagios
```

show?

----------

## jonfr

I get this. Premissions appears to be ok.

```
ls -lh /etc/nagios

total 68K

-rw-rw-r-- 1 nagios nagios  11K Mar 25 23:12 cgi.cfg

-rw-r--r-- 1 root   root     21 Mar 25 23:50 htpasswd.users

-rw-rw-r-- 1 nagios nagios  42K Mar 25 23:12 nagios.cfg

drwxrwxr-x 2 nagios nagios 4.0K Mar 25 23:12 objects

-rw-rw---- 1 nagios nagios 1.4K Mar 25 23:12 resource.cfg

```

----------

## bbgermany

hi,

the error you get is in your webbrowser, right? which user is running apache? add the user to the nagios group, if its not root. iirc i had to do it this way.

bb

----------

## jonfr

I have apache running apahce. But I will do it as you suggest.

----------

## bbgermany

did you get your nagios running now?

bb

----------

## jonfr

I haven't had time for this yet. But I am going fix this later today, when I have the time.

----------

## PatG

I would suggest

# chown -R nagios:apache /etc/nagios

# chown -R nagios:apache /usr/share/nagios

----------

