Page 1 of 1

localhost/nagios point to PNP4Nagios environment test

Posted: Thu Apr 19, 2018 5:36 am
by Alessandro71
Hi all,
I've installed PNP4Nagios, but the "PNP4Nagios Environment Tests" page opens int the URL http://localhost/nagios and not in the
URL http://localhost/pnp4nagios/ I haven't the possibility to go to the home page of Nagios.
All is running well: Apache2 service, Nagios and Pnp4Nagios.

Have you any suggestion?

Thanks

Alessandro

Re: localhost/nagios point to PNP4Nagios environment test

Posted: Thu Apr 19, 2018 9:50 am
by scottwilkerson
Car you tar up everything in your /etc/httpd directory and attach to the post, I believe you may have a error in you httpd configurations.

Re: localhost/nagios point to PNP4Nagios environment test

Posted: Thu Apr 19, 2018 10:07 am
by Alessandro71
Hi scottwilkerson,
following you can find these informations:
ls -al /etc/httpd/conf.d/
totale 16
drwxr-xr-x 2 root root 4096 apr 19 16:09 .
drwxr-xr-x 3 root root 4096 mar 15 18:00 ..
-rw-r--r-- 1 root root 1679 apr 19 16:09 nagios.conf
-rw-r--r-- 1 root root 922 apr 19 15:41 pnp4nagios.conf

pnp4nagios.conf:

Code: Select all

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER

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 symLinksIfOwnerMatch
                # Installation directory
                RewriteBase /pnp4nagios/
                # Protect application and system files from being viewed
                RewriteRule "^(?:application|modules|system)/" - [F]
                # 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]
        </IfModule>
</Directory>
nagios.conf

Code: Select all

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file.  Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin"> 
#  SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
#        Require host 127.0.0.1

         AuthName "Nagios Access"
         AuthType Basic
         AuthUserFile /usr/local/nagios/etc/htpasswd.users
         Require valid-user
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

      AuthName "Nagios Access"
      AuthType Basic
      AuthUserFile /usr/local/nagios/etc/htpasswd.users
      Require valid-user    
   </IfVersion>
</Directory>

Alias /nagios "/usr/local/nagios/share"             

<Directory "/usr/local/nagios/share">
#  SSLRequireSSL
   Options None   
   AllowOverride None
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
#        Require host 127.0.0.1

         AuthName "Nagios Access"
         AuthType Basic
         AuthUserFile /usr/local/nagios/etc/htpasswd.users
         Require valid-user
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

      AuthName "Nagios Access"
      AuthType Basic
      AuthUserFile /usr/local/nagios/etc/htpasswd.users
      Require valid-user
   </IfVersion>
</Directory>

Thanks

Alessandro

Re: localhost/nagios point to PNP4Nagios environment test

Posted: Thu Apr 19, 2018 11:07 am
by scottwilkerson
this looks correct, it sounds like you did something that overwrite the index.php in your nagios directory with the one that creates the "PNP4Nagios Environment Tests"

unzip the attached and place the index.php in /usr/local/nagios/share

This is from Nagios 4.2.4

Re: localhost/nagios point to PNP4Nagios environment test

Posted: Thu Apr 19, 2018 11:27 am
by Alessandro71
:D :D :D now the page works, but pnp4nagios no, but it does not do anything.
Thank you very much

Alessandro

Re: localhost/nagios point to PNP4Nagios environment test

Posted: Thu Apr 19, 2018 11:53 am
by scottwilkerson
Alessandro71 wrote::D :D :D now the page works, but pnp4nagios no, but it does not do anything.
Thank you very much

Alessandro
Glad I could assist getting Nagios going, you'll need to reach out to the pnp4nagios people if you want to pursue getting it going.