Pnp4Nagios Error with Apache

Pnp4Nagios Error with Apache

I had a working setup with PNP4Nagios and Nagios. Everything was great.

Friday, I installed NagiosQL.

Since then, PNP4Nagios's web UI doesn't work anymore!

I get this error when trying to access it:

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

Mod_rewrite is enabled, but I guess the above error indicates that it's not working correctly??

The links generated by Nagios (that used to work, before Friday..) look like this:


Here is the relevant output of Apache's error.log:

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

Here is my /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 
            RewriteRule .*  [PT,L]
    </IfModule>
</Directory>

And my /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 
            require user 
            require user 
            require user 
    </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>

I'm really lost here.

1 Answer

Wow!!

It turns out that the answer was really simple :S After all these days of torture!!

I found the answer here.

Here it is:

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

That simple!

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Elena Rostova
Author

Elena Rostova

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.