Nagios - 禁止访问403

时间:2014-06-24 00:21:03

标签: nagios

我已经看到了这方面的一些问题,但不幸的是,这并没有解决我的问题。如果您能够在虚拟机上成功运行OpenSuse上的Nagios,请告诉我。

我在两台不同的计算机上安装了Open Suse。一个通过VMware,一个通过VirtualBox,它们可以运行任何其他应用程序。访问网络等没问题。

但是按照以下提到的开放Suse安装步骤之后: http://nagios.sourceforge.net/docs/nagioscore/4/en/quickstart-opensuse.html

当我在firefox上启动localhost / nagios(在帖子中有目的地删除了http://)时,我发现“Access Forbidden!Error 403”消息。安装看起来很好,没有错误。我使用的是OpenSuse 13.1版本,我尝试使用nagios版本4.0.6和4.0.7以及插件2.0.2。

我确定,apache(apache2),gcc,gcc ++,kernel-source(由用户在nagios论坛中建议),php,apache2-mod_php5,make等都已安装。 apache2服务正在运行并在运行后重新启动: make install-webconf

用户名和密码正确键入:)。

请你指导一下我的问题。

这是apache2 / error_log:

[Mon Jun 23 14:50:57.331306 2014] [autoindex:error] [pid 6138] [client 127.0.0.1:46061] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 14:51:57.317399 2014] [autoindex:error] [pid 6139] [client 127.0.0.1:46066] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 14:52:57.299316 2014] [autoindex:error] [pid 24637] [client 127.0.0.1:46068] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 14:57:57.289446 2014] [autoindex:error] [pid 6137] [client 127.0.0.1:46077] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 14:58:59.372027 2014] [autoindex:error] [pid 6136] [client ::1:59841] AH01276: Cannot serve directory /usr/local/nagios/share/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:02:57.274830 2014] [autoindex:error] [pid 6139] [client 127.0.0.1:46119] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:07:57.263871 2014] [autoindex:error] [pid 24637] [client 127.0.0.1:46143] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:12:57.251875 2014] [autoindex:error] [pid 6137] [client 127.0.0.1:46147] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:17:57.239626 2014] [autoindex:error] [pid 6135] [client 127.0.0.1:46152] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:22:57.228968 2014] [autoindex:error] [pid 6136] [client 127.0.0.1:46155] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:27:57.217628 2014] [autoindex:error] [pid 6138] [client 127.0.0.1:46158] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:32:57.206081 2014] [autoindex:error] [pid 6139] [client 127.0.0.1:46161] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:37:57.197239 2014] [autoindex:error] [pid 24637] [client 127.0.0.1:46165] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:42:57.180851 2014] [autoindex:error] [pid 6137] [client 127.0.0.1:46168] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:47:57.165708 2014] [autoindex:error] [pid 6135] [client 127.0.0.1:46172] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:52:57.154070 2014] [autoindex:error] [pid 6136] [client 127.0.0.1:46174] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:57:57.136265 2014] [autoindex:error] [pid 6138] [client 127.0.0.1:46182] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:02:57.122498 2014] [autoindex:error] [pid 6139] [client 127.0.0.1:46186] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:07:57.110446 2014] [autoindex:error] [pid 24637] [client 127.0.0.1:46191] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:12:57.092886 2014] [autoindex:error] [pid 6137] [client 127.0.0.1:46197] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:17:57.077070 2014] [autoindex:error] [pid 6135] [client 127.0.0.1:46204] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:22:57.067403 2014] [autoindex:error] [pid 6136] [client 127.0.0.1:46206] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:27:57.054625 2014] [autoindex:error] [pid 6138] [client 127.0.0.1:46209] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:32:57.042447 2014] [autoindex:error] [pid 6139] [client 127.0.0.1:46213] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:37:57.030372 2014] [autoindex:error] [pid 24637] [client 127.0.0.1:46219] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive

这是apache2 / acsess_log:

::1 - - [23/Jun/2014:14:58:59 -0700] "GET /nagios HTTP/1.1" 401 1233 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0"
::1 - nagiosadmin [23/Jun/2014:14:58:59 -0700] "GET /nagios HTTP/1.1" 301 310 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0"
::1 - - [23/Jun/2014:14:58:59 -0700] "GET /nagios/ HTTP/1.1" 403 1004 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0"
::1 - nagiosadmin [23/Jun/2014:15:01:43 -0700] "GET /nagios/index.php HTTP/1.1" 200 1628 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0"
127.0.0.1 - - [23/Jun/2014:15:02:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:07:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:12:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:17:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:22:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:27:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:32:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:37:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:42:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:47:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:52:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:57:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:02:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:07:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:12:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:17:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:22:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:27:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:32:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:37:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:42:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"

conf文件是:

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
#  SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
#  SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>

3 个答案:

答案 0 :(得分:2)

我知道这是一个非常老的线程,我今天面临类似的问题但是在Centos7的情况下,我唯一能解决这个问题的方法是将index.php添加到DirectoryIndex参数,不知道这对于它有多大帮助OpenSuse案例

httpd.conf

已更改

 <IfModule dir_module>
  DirectoryIndex index.html
   </IfModule>

 <IfModule dir_module>
    DirectoryIndex index.html index.php
  </IfModule>

答案 1 :(得分:0)

我刚遇到同样的问题(在Raspberry Pi 3上使用Raspian Jessie,使用来自http://www.howtovmlinux.com/articles/rasberry-pi/install-nagios-core-latest-version-4-x-x-on-raspberrypi-jessie.html的安装说明)我会羞耻地承认这是因为我跳过安装中的关键步骤:我忽略了做“make install”!

似乎不太可能有其他人会犯同样的错误,但如果他们这样做,这是我的解决方案:运行“make install”! : - ]

答案 2 :(得分:0)

我在CentOS 7上有一个非常相似的问题,但我刚刚安装了php软件包,它就起作用了

yum install php-5.4