Nagios interface won't display, php file downloaded instead

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios interface won't display, php file downloaded inst

Post by abrist »

No problem. My suggestion is to start with a fresh install of centos 6.x and install the required dependencies for core, and then core from source. Only once everything is tested as working should you proceed to installing other services.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
agenerette
Posts: 50
Joined: Wed Jul 25, 2012 5:09 pm

Re: Nagios interface won't display, php file downloaded inst

Post by agenerette »

One more thing on this one...

The programmer that I've been working with makes it sound like there's a quick, simple fix, but I'm not entirely sure what he means:

The problem is probably Apache's config files -- the PHP engine must be turned on in any directory that is supposed to recognize a .php file. All you need to enable PHP in a directory is this in the appropriate apache configuration file in /etc/apache2/sites-enabled:

<Directory /home/www/some/directory>
php_flag engine on
</Directory>

That's it. Once done, PHP will work in /home/www/some/directory and all directories under it.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios interface won't display, php file downloaded inst

Post by abrist »

agenerette wrote:<Directory /home/www/some/directory>
php_flag engine on
</Directory>
Interesting. Has php disabled systemwide? This directive (php_flag engine on) does not exist on any of my test systems.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
agenerette
Posts: 50
Joined: Wed Jul 25, 2012 5:09 pm

Re: Nagios interface won't display, php file downloaded inst

Post by agenerette »

I'm looking around for places where that flag might be getting set, one way or another, on the host. 'Haven't found anything just yet.

It's true for me, also, that I've never had to do anything with php_flag. None of the notes that I've found on installing Nagios mention setting it, either. This is part of the reason that I was confused by what my peer had mentioned. I'm not really facile, at all, with php.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios interface won't display, php file downloaded inst

Post by abrist »

Unless you have implemented specific security restrictions, enabling php in apache (which you have done) is all that is required. This sounds like an environment specific issue.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
agenerette
Posts: 50
Joined: Wed Jul 25, 2012 5:09 pm

Re: Nagios interface won't display, php file downloaded inst

Post by agenerette »

This is insane, but I wanted to share it with the Community, just to try and save someone the headache that I dealt with...

For the problem with getting the Nagios console up-and-running, that programmer peer of mine recommended adding "php_flag engine on" to the appropriate configuration file. I've not had to do this in the past, after installing Nagios. On the host in question, though, I found:

root@ccb1:/etc/apache2# grep -R php_flag *
sites-available/default: php_flag engine off
sites-enabled/000-default: php_flag engine off

Which I hadn't put in place. I modified the files such that the php_flag was set to "on", restarted the apache2 service, and the console came up.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios interface won't display, php file downloaded inst

Post by abrist »

Brilliant. Glad it is fixed. Very strange though, as I have yet to see a distribution which turns this off in the default apache configs. What distro was this exactly?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
agenerette
Posts: 50
Joined: Wed Jul 25, 2012 5:09 pm

Re: Nagios interface won't display, php file downloaded inst

Post by agenerette »

'Sorry for the delayed response, but I've been away for a bit.

root@ccb1:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.3 LTS
Release: 12.04
Codename: precise
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios interface won't display, php file downloaded inst

Post by slansing »

Interesting, I'm trying to hunt this down, no luck yet.
Locked