[SOLVED] Nagios web interface stopped working after squeeze upgrade
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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>
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?
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...
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?
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.
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.
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.
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?
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/
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.