Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
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
add comment

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)

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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