LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-05-2011, 03:56 PM   #1
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Nagios web interface stopped working after squeeze upgrade


I recently updated to squeeze following the Debian release note steps, and most everything went smoothly. However, I'm now unable to get into the Nagios web interface. The service is still running and sends email notifications of issues as usual, but logging into the web interface gives me a 403 Forbidden error. In my apache error log, it says:

Code:
[Sat Mar 05 13:48:25 2011] [error] [client ::1] Directory index forbidden by Options directive: /usr/share/nagios3/htdocs/
Any idea what changed in the upgrade to squeeze that could have caused this?
 
Old 03-06-2011, 06:22 AM   #2
norbert74
Member
 
Registered: Apr 2006
Posts: 63

Rep: Reputation: 23
The update may have overwritten your nagios.conf inside your apache config.
 
Old 03-06-2011, 10:57 AM   #3
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
I just checked and my nagios.conf is still there.
 
Old 03-07-2011, 11:38 AM   #4
norbert74
Member
 
Registered: Apr 2006
Posts: 63

Rep: Reputation: 23
Is the content of nagios.conf the same?
Please check the "Options" directives in this file. On my system it looks like this:
Code:
Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
   ...
</Directory>
 
Old 03-07-2011, 09:17 PM   #5
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
Yep, I checked against a backup and that file is exactly the same, pointing to the same /usr/share/nagios3/htdocs and the same htpasswd file. I tried making a new entry in the htpasswd file with a test username and password, and that gets permissions denied too. Any other ideas?
 
Old 03-08-2011, 03:41 AM   #6
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by jrdioko View Post
Yep, I checked against a backup and that file is exactly the same, pointing to the same /usr/share/nagios3/htdocs and the same htpasswd file. I tried making a new entry in the htpasswd file with a test username and password, and that gets permissions denied too. Any other ideas?
Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
Options None
AllowOverride None
Order allow,deny
Allow from all
...
</Directory>

Check your http logs again.
The problem is with the Options directive.

You have no Directory Index in the path where the nagios web files are...
 
Old 03-08-2011, 03:44 AM   #7
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by centosboy View Post
Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
Options None
AllowOverride None
Order allow,deny
Allow from all
...
</Directory>

Check your http logs again.
The problem is with the Options directive.

You have no Directory Index in the path where the nagios web files are...
Actually, scrub what i said above.

Code:
[Sat Mar 05 13:48:25 2011] [error] [client ::1] Directory index forbidden by Options directive: /usr/share/nagios3/htdocs/

Your config file and the path given above do not match?

Code:
<Directory "/usr/local/nagios/share">

Code:
Directory index forbidden by Options directive: /usr/share/nagios3/htdocs/
 
Old 03-08-2011, 05:24 AM   #8
norbert74
Member
 
Registered: Apr 2006
Posts: 63

Rep: Reputation: 23
Another possible cause is that the apache2 mod_php module is not installed and thus the DirectoryIndex directive in the main apache config file is without 'index.php'. Can you still execute php scripts?
 
Old 03-08-2011, 05:44 AM   #9
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by norbert74 View Post
Another possible cause is that the apache2 mod_php module is not installed and thus the DirectoryIndex directive in the main apache config file is without 'index.php'. Can you still execute php scripts?
This is what i originally thought....but....it seems more likely that the DocRoot for nagios is incorrect?
We shall only know if the OP can confirm the correct DocRoot for nagios and the contents of that directory.
 
Old 03-08-2011, 08:56 PM   #10
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
My nagios.conf file has the following:

Code:
<DirectoryMatch (/usr/share/nagios3/htdocs|/usr/lib/cgi-bin/nagios3)>
        Options FollowSymLinks

        DirectoryIndex index.html

        AllowOverride AuthConfig
        Order Allow,Deny
...
"php -v" gives me:

Code:
PHP 5.3.3-7 with Suhosin-Patch (cli) (built: Jan  5 2011 12:52:48) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
Again, the nagios apache conf file is untouched from when it worked to when it stopped working. And the only change on my system in between was an upgrade from Debian lenny to squeeze.
 
Old 03-09-2011, 01:22 AM   #11
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
index.php is missing from DirectoryIndex in the apache.conf file.
 
Old 03-09-2011, 10:11 AM   #12
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
I tried changing DirectoryIndex from index.html to index.php, restarting apache, and trying again, but I got the same error. I can't imagine why it would be an apache conf issue since I'm using the default that comes with the Debian package and I never changed that file.
 
Old 03-09-2011, 10:58 AM   #13
norbert74
Member
 
Registered: Apr 2006
Posts: 63

Rep: Reputation: 23
1. Make sure that your nagios.conf is actually used by apache by making a syntax error in it and restart apache (to see if the restart fails)
2. Put a simple .html file in your nagios docroot and try if you can at least access it
3. Put a simple .php file in your nagios docroot and try to access it directly (http://.../test.php)
4. Look if you have a .htaccess file in your nagios docroot
5. What exactly is the url that you use to access the nagios webpage?
 
Old 03-09-2011, 09:22 PM   #14
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
1. I put a syntax error in the DirectoryIndex line and tried restarting apache, and it successfully errored out.
2. I put a test.html file in /usr/share/nagios3/htdocs and visited http://localhost/nagios3/test.html. I was prompted for my username/password, which I entered, and was then brought to a 404 page (not a 403 like before!)
3. Same with the php file
4. There's no .htaccess file in /usr/share/nagios3/htdocs. Authentication is done through a htpasswd file, specified by this directive in the conf file: AuthUserFile /etc/nagios3/htpasswd.users. That file was generated with the username/password I'm using. Again, neither the htpasswd file nor the apache conf has changed since it stopped working.
5. http://localhost/nagios3/
 
Old 03-10-2011, 06:43 AM   #15
norbert74
Member
 
Registered: Apr 2006
Posts: 63

Rep: Reputation: 23
Quote:
2. I put a test.html file in /usr/share/nagios3/htdocs and visited http://localhost/nagios3/test.html. I was prompted for my username/password, which I entered, and was then brought to a 404 page (not a 403 like before!)
This is strange, you log in successfully, the file is there but you get a 404.
This indicates that you are not there where you have put the file.

Please post your Alias directive you have set for /nagios3 in the apache config.
 
  


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 05:57 PM.

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