我在 freebsd 9 下安装了 nagios,但无法找到在浏览器中公开它的正确方法(从其他 PC)。我认为问题出在索引中,或者没有索引文件(除了 main.php)。Apache 说语法没问题。目录的权限是 777。日志显示:
选项指令禁止的目录索引:/usr/local/www/nagios/。
这是我的配置:
ScriptAlias /nagios/cgi-bin/ /usr/local/www/nagios/cgi-bin/
Alias /nagios /usr/local/www/nagios/
<Directory /usr/local/www/nagios>
Options +Indexes FollowSymLinks +ExecCGI
AllowOverride Indexes AuthConfig FileInfo
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUSerFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
</Directory>
<Directory /usr/local/www/nagios/cgi-bin>
Options +ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUSerFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
</Directory>
我认为问题可能出在索引上?当我删除选项时,它是公开的并且可用,但列出了文件并说索引被禁止。
答案1
嗯,您的安装肯定应该有一个 Index.php 文件!
我会先确保一切都安装正确!
接下来,我要确保 Nagios Web 文件实际上位于您上面提到的文件路径中,而不是:
在 /usr/local/etc/nagios/共享
另外,你的 nagios.conf 稍微有错误:
Alias /nagios "/usr/local/www/nagios/"
<Directory "/usr/local/www/nagios">
Options +Indexes FollowSymLinks +ExecCGI
AllowOverride Indexes AuthConfig FileInfo
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUSerFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
</Directory>
ScriptAlias /nagios/cgi-bin/ "/usr/local/www/nagios/cgi-bin/"
<Directory "/usr/local/www/nagios/cgi-bin">
Options +ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUSerFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
</Directory>