最近一直做nagios监控服务器,从中也遇到了一点问题,今天晚上终于把它解决了.呵呵.apache 的httpd.conf的配置如下
         <Directory "/usr/local/nagios/sbin">
             AuthType Basic
             Options +ExecCGI         #用Options显式地允许CGI的执行
             AllowOverride None
             Order allow,deny
             Allow from all
             AuthName "Nagios Access"
             AuthUserFile /usr/local/nagios/etc/htpasswd
             Require valid-user
             AddHandler cgi-script cgi pl   #AddHandler指令告诉服务
                                                      器所有带有cgi或pl后缀的文件 
                                                      是CGI程序
         </Directory>
    
        Alias /nagios /usr/local/nagios/share
         <Directory "/usr/local/nagios/share">
            AuthType Basic
            Options None
            AllowOverride None
            Order allow,deny
            Allow from all
            AuthName "nagios Access"
            AuthUserFile /usr/local/nagios/etc/htpasswd
            Require valid-user
        </Directory>
之前一直没成功的原因是没有在配置文件里加上AddHandler cgi-script cgi pl 这条批令