LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-10-2011, 10:14 AM   #16
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30

Not sure what I was doing wrong before, but again I put a test.html in /usr/share/nagios3/htdocs and went there is a browser, got prompted for a password, and successfully saw the page. Maybe because the first time the permissions were 644 (I believe) and this time I chmod'ed them to 755?

But same deal, going to localhost/nagios3 gives me a 403 Forbidden (without prompting for login this time, because I already successfully logged in to get to the test page in the same session).
 
Old 03-12-2011, 03:25 AM   #17
norbert74
Member
 
Registered: Apr 2006
Posts: 63

Rep: Reputation: 23
Actually it can't be a huge problem to execute a php script with apache...

Have you tried to directly access the php file like http://localhost/nagios3/index.php instead of just http://localhost/nagios3 ? Is there a difference?

The error log messages says clearly that the access is not possible because of a wrong DirectoryIndex directive in the Apache config. Which means either the index.php is missing in the directive or the index.php cannot be accessed. You have already added index.php to the DirectoryIndex directive and it is still there, right?
Open /etc/passwd and give your apache user a shell at the end of the line, something like
www-data:x:--:--:www-data:/var/www:/bin/bash
Then
su - www-data
id
and now try to open /usr/share/nagios3/htdocs/index.php with vi or similar.
Remove the shell in /etc/passwd again.

What is the output of these commands:
ls -lh /usr/share/nagios3/htdocs
apache2ctl -M

Post the complete content of these file (without comments please):
mods-enabled/dir.conf
mods-enables/php5.conf
apache2.conf
nagios.conf

Last edited by norbert74; 03-12-2011 at 03:28 AM.
 
1 members found this post helpful.
Old 04-19-2011, 09:05 PM   #18
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
Thanks again for all the advice. I decided to tackle this again, and before digging into your suggestions, I tried reinstalling nagios (aptitude remove nagios3-core, aptitude install nagios3). After that everything works as normal again. So I'm not sure exactly what happened, but I guess some files were missing or something wasn't properly installed or removed during the upgrade.
 
Old 06-01-2011, 12:20 PM   #19
beachbill
LQ Newbie
 
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
For the benefit of others searching for a solution to this issue:

If you upgrade to nagios3/squeeze, but choose to NOT overwrite your existing config files, you will need to edit /etc/nagios3/apache2.conf, replacing

DirectoryIndex index.html

with

DirectoryIndex index.php
 
1 members found this post helpful.
Old 10-03-2012, 04:26 PM   #20
BloodyIron
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
I had this same problem.

What confused me was that there were two conf files which confused me

/etc/nagios3/apache2.conf

this file did have index.php and .html referenced

and

/etc/apache2/enabled-sites/000-default

this file referenced the nagios /usr/share/nagios3/htdocs

however it only referenced index.html, not index.php

after adding index.php it now worked


another thing that is worth noting is that /usr/share/nagios3/htdocs and it's entire contents were set to root:root for ownership. I'm not sure if this is what it was like before (because I did an upgrade for ubuntu 10.04 to 12.04), so I changed the ownership of the folder and the entire contents to www-data:www-data and chmoded the same files to 755. This was before the index.php change so I don't know if these changes are necessary.

One thing is for sure, the log at /var/log/apache2/error.log kept talking about /usr/share/nagios3/htdocs not having access, as outlined in previous posts, so that helped guide me.

Thanks for the earlier help!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create another user for Nagios web interface bartsimpson Linux - Newbie 11 03-26-2014 08:49 AM
cannot find Nagios web interface (Nagios 3.2.0) and O/S = Fedora 10 gutiojj Linux - Newbie 7 02-04-2010 08:55 AM
[Nagios-User] Personalised Web Interface fabbie Linux - Software 7 12-05-2009 12:16 PM
Nagios Web Interface JPawlak Linux - Software 1 08-22-2003 03:49 PM
Nagios Web Interface sanfran49 Linux - Software 6 07-15-2003 10:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 10:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration