Nagios 显示“未找到”错误

Nagios 显示“未找到”错误

我已经在 Ubuntu 系统中安装了 nagios 包。打开配置页面后,localhost/nagios3我已成功登录。之后,当我从左侧菜单中选择任何选项时,它会显示以下错误之一

The requested URL /cgi-bin/nagios3/extinfo.cgi was not found on this server.
The requested URL /cgi-bin/nagios3/showlog.cgi was not found on this server.
The requested URL /cgi-bin/nagios3/notifications.cgi was not found on this server.
The requested URL /cgi-bin/nagios3/history.cgi was not found on this server.
The requested URL /cgi-bin/nagios3/status.cgi was not found on this server.
The requested URL /cgi-bin/nagios3/outages.cgi was not found on this server.
The requested URL /cgi-bin/nagios3/statuswrl.cgi was not found on this server.
The requested URL /cgi-bin/nagios3/trends.cgi was not found on this server.

Apache/2.2.14 (Ubuntu) Server at 192.168.1.7 Port 80

如何解决这个问题呢 ?

答案1

请检查 Apache 配置文件/etc/apache2/sites-available/nagios3.conf

/etc/apache2/conf.d/nagios3.conf or similar有类似“ScriptAlias”的条目

以下(请确保您具有正确的文件系统路径):

  ScriptAlias /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3
  ScriptAlias /nagios3/cgi-bin /usr/lib/cgi-bin/nagios3

答案2

还要检查您已启用哪些 apache 模块 - 您可以使用 查看它们ls -la /etc/apache2/mods-enabled。您需要启用 php 和 cgi 模块。您需要安装 php,并且可能需要更改已启用的 mpm 模块。在 Ubuntu 16.04 上,以下是我必须运行才能解决此错误的命令:

sudo a2dismod mpm_event
sudo a2enmod mpm_prefork
sudo a2enmod cgi
sudo apt-get install libapache2-mod-php
sudo a2enmod php7.0
sudo service apache2 restart

可用模块列在 中/etc/apache2/mods-available

答案3

在同样的情况下,我发现我缺少一些依赖项,因为教程中没有包括它们。我找到了一个,它解决了我的问题。你应该检查一下这个安装是否比你拥有的多 -

apt-get install build-essential php5-gd wget libgd2-xpm-dev libapache2-mod-php5 apache2-utils daemon unzip

相关内容