今天配置nagios的时候遇到了一些麻烦.前面的步骤都一切顺利,但是修改好所有的cfg后,点击左边的菜单时总是提示Internal Server Error错误.错误如下:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

出现这种问题,给大家推荐一种解决方法:

关闭系统的selinux.


SElinux对于Linux新手来说可能是一个比较难于理解的工具,对于一般的新手系统管理员来说,你可以先跳过这个工具,简单的disable掉它。
SElinux很大程度上解决了简单的权限认证不能够保证系统真正安全的问题,是美国军方提出的。所以对于系统复杂,分工详细,安全要求比较高的系统来 说,这是一个好东西,不过同时带来的是较为复杂的设置(一般非常强大的可定制工具都是这样),要求管理员对系统和程序比较了解,否则可能把自己希望的服务 挡掉继而出现本文提到的类似问题。
感兴趣的朋友可以直接查看SElinux的官方文档,来获取更多消息。

以下介绍一下SELinux相关的工具
/usr/bin/setenforce 修改SELinux的实时运行模式
setenforce 1 设置SELinux 成为enforcing模式
setenforce 0 设置SELinux 成为permissive模式
如果要彻底禁用SELinux 需要在/etc/sysconfig/selinux中设置参数selinux=0
,或者在/etc/grub.conf中添加这个参数


#setstatus -v
察看系统的状态
以下是运行输出,请参考
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Policy version: 18


不重启关闭selinux的解决办法:
执行命令:setenforce 0

在新版本中的Red Hat 和 Fedora 上,修改档案/etc/sysconfig/selinux:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
把 SELINUX设定为disable, 下次启动系统后将会停止SElinux。
Linux核心参数(Kernel Parameter)
或者可以在核心参数后加上: selinux=0 (停止) 或 selinux=1 (开启)参数
档案/boot/grub/menu.lst
title Fedora Core (2.6.18-1.2798.fc6)
 root (hd0,0)
 kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/ rhgb quiet selinux=0
 initrd /initrd-2.6.18-1.2798.fc6.img
检查SELinux现时况态
要知到你现在是否使用 SELinux:
# getenforce
disabled


呵呵,这样就搞定了,你搞定没?