Apache 的 PNP4Nagios 错误

Apache 的 PNP4Nagios 错误

我有一个使用 PNP4Nagios 和 Nagios 的工作设置。一切都很顺利。

星期五,我安装了 NagiosQL。

从那时起,PNP4Nagios 的 Web UI 不再起作用!

当我尝试访问它时出现此错误:

The requested URL /pnp4nagios/index.php/graph was not found on this server.

Mod_rewrite启用,但我猜测上述错误表明它不能正常工作??

Nagios 生成的链接(在星期五之前可以正常工作..)如下所示:

http://srv-nagios/pnp4nagios/index.php/graph?host=win-server&srv=PING



以下是 Apache 的相关输出error.log

[Fri Mar 02 15:06:43 2012] [error] [client 172.16.0.139] File does not exist: /usr/local/pnp4nagios/share/index.php/graph

这是我的/etc/apache2/conf.d/pnp4nagios.conf

Alias /pnp4nagios "/usr/local/pnp4nagios/share"

<Directory "/usr/local/pnp4nagios/share">
    AllowOverride None
    Order allow,deny
    Allow from all
    #
    # Use the same value as defined in nagios.conf
    #
    #AuthName "Nagios Access"
    #AuthType Basic
    #AuthUserFile /usr/local/nagios/etc/htpasswd.users
    Require valid-user
    <IfModule mod_rewrite.c>
            # Turn on URL rewriting
            RewriteEngine On
            Options FollowSymLinks
            # Installation directory
            RewriteBase /pnp4nagios/
            # Protect application and system files from being viewed
            RewriteRule ^(application|modules|system) - [F,L]
            # Allow any files or directories that exist to be displayed directly
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            # Rewrite all other URLs to index.php/URL
            RewriteRule .* index.php/$0 [PT,L]
    </IfModule>
</Directory>

和我的/etc/apache2/sites-available/default

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /usr/local/nagios/share/vshell
    <Directory />
            Options Indexes FollowSymLinks
            AllowOverride None
            Allow from all
            AuthType Kerberos
            AuthName "Nagios Authentification"
            KrbMethodNegotiate On
            KrbMethodK5Passwd On
            KrbAuthRealms 1234.COM
            Krb5KeyTab /etc/1234.keytab
            require user [email protected]
            require user [email protected]
            require user [email protected]
            require user [email protected]
    </Directory>
    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>
    ScriptAlias /cgi-bin/ /usr/local/nagios/sbin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>


    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

我真的在这儿迷路了。

答案1

哇!!

事实证明答案非常简单:S 经过这么多天的折磨!!

我找到了答案这里

这里是:

apt-get purge libapache2-mod-php5 php5 && apt-get install libapache2-mod-php5 php5
service apache2 restart

就这么简单!

相关内容