日期:2014-05-16  浏览次数:20584 次

apache2 + nagios-3.2.3 不能访问http://localhost/nagios
网上的帖子几乎看的差不多了,还是没有解决问题。apache2 ,nagios ,php  都是源码安装,还是不行。访问http://localhost/nagios 始终显示:

Forbidden
You don't have permission to access /nagios/ on this server.



换成http://localhost/nagios/index.php 就显示:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

<html>
<head>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<title>Nagios Core</title>
<link rel="shortcut icon" href="images/favicon.ico" type="image/ico">
</head>

<?php
 // allow specifying main window URL for permalinks, etc.
$corewindow="main.php";
if(isset($_GET['corewindow'])){

// default window url may have been overridden with a permalink...
$rawurl=$_GET['corewindow'];

// parse url and remove permalink option from base
$a=parse_url($rawurl);

// build base url
if(isset($a["host"]))
$windowurl=$a["scheme"]."://".$a["host"].$a["path"]."?";
else
$windowurl=$a["path"]."?";
... ... ... ...


apache2   下的log显示:
Directory index forbidden by Options directive: /usr/local/nagios/share/

权限也是对的阿,755,

drwxr-xr-x  9 nagios nagios 216 2011-06-18 15:51 nagios

不知道哪位大侠help me 一下 ,非常感谢!


------解决方案--------------------
你连apache和php都没装好  你没看见  访问到的页面都直接出来了php源码了?
如果你不会  就不要装高手去源码安装

源码安装apache+php 看这里http://litvip.com/2011/02/18/26
------解决方案--------------------
引用:
收到,可以试试看。apache应该是装好的,我跑Django都没有任何问题。系统是ubuntu,php我用apt-get装,nagios是无法正常运行。不知道为啥?估计还是出在php上。

题目上说php源码 这里又说是apt-get!

我说的没装好,是说你的apache和php的关联设置的不对,所以访问的时候php并没有被解析,而是直接把文件的内容原封不动的显示了。