I am trying to install Nagios on a centos vm on Ec2 from yum.

When trying to restart httpd to get Nagios up I was hit with this bug form the http error log

Attempt to serve directory: /usr/share/nagios/html/

This is my nagios.conf

<VirtualHost *>
        ServerName nagios.xx.com
        ServerAlias nagios.xx.com

        ScriptAlias /nagios/cgi-bin/ /usr/lib64/nagios/cgi-bin/
        <Directory /usr/lib64/nagios/cgi-bin/>
           Options ExecCGI
           order deny,allow
           deny from all
           allow from 127.0.0.1
           AuthType Basic
           AuthUserFile /etc/nagios/passwd
           AuthName "nagios"
           require valid-user
        </Directory>

        Alias / /usr/share/nagios/html/
        <Directory /usr/share/nagios/html/>
           Options None
           order deny,allow
           deny from all
           allow from 127.0.0.1
           AuthType Basic
           AuthUserFile /etc/nagios/htpasswd.users
           AuthName "nagios"
           require valid-user
        </Directory>
</VirtualHost>

This is the html directory perm

drwxr-xr-x 8 apache apache 4096 Jun 20 17:53 html 

The parent directories have perms like this

nagios

drwxr-xr-x   3 root root  4096 Jun 20 17:53 nagios

share

drwxr-xr-x 103 root root  4096 Jun 20 17:53 share

usr

drwxr-xr-x 13 root root  4096 Feb 24 16:30 usr

Can someone help me out?

link|improve this question

56% accept rate
1  
What version of Nagios are you running? – hfranco Jun 27 '11 at 12:02
newest versions of Nagios have PHP code instead of cgi-bin perl, so your ScriptAlias would be wrong and a DirectoryIndex index.php would fit better. – regilero Jun 27 '11 at 19:48
feedback

1 Answer

Replace Alias / /usr/share/nagios/html/ with DocumentRoot /usr/share/nagios/html/ if you want to run it from the / of your domain.

Btw you know you can only access the directory from your local box with allow from 127.0.0.1, right? (unless you use this to reverse-proxy)

link|improve this answer
Checking the date of this question after posting I feel like a grave-digger .... – Chris Dec 7 '11 at 14:21
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.