Nagios Done

No errors, no warning, thanks to all that contributed., but my web interface is still not functioning and I don’t know why. I made the neccessary changes or what I thought was necessary in the httpd.conf file and still localhost/nagios/ wasn’t showing please offer some help. :frowning:

canyou post your httpd.conf and maybe your log files. or any errors you encounter? check also is you httpd is running.

the httpd file is really long so I’ll only so what I input in the file and where it was done. It’s an apache2 server that I’m using.

ScriptAlias: This controls which directories contain server scripts.

ScriptAliases are essentially the same as Aliases, except that

documents in the realname directory are treated as applications and

run by the server when requested rather than as documents sent to the client.

The same rules about trailing “/” apply to ScriptAlias directives as to

Alias.

ScriptAlias /cgi-bin/ “/usr/local/apache2/cgi-bin/”

Raemur’s entry into the code for nagios

Configure alias for CGIs

ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
<Directory “/usr/local/nagios/sbin”>
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all

Alias /nagios /usr/local/nagios/share
<Directory “/usr/local/nagios/share”>
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all

now as for the errors. When I go to localhost/ the apache2 server works. when I go to localhost/nagios that doesn’t work. I get a 404 error. I’ve restarted the server as well as tried to make small changes in the file like change the postion of what I’ve inputted. however none of that seems to work.

You may have syntax errors in the httpd.conf.
Try doing it the way the docs state. Just copy/paste if you wish.

Your syntax is close, but not exact and I’m not going to test if that makes a diff or not, but hopefully, if you correct the syntax, it will fix it.

This from the docs:
ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/
<Directory “/usr/local/nagios/sbin/”>
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all

Important! The Script-Alias line above must come before the Alias line below. Otherwise Apache will parse the lines differently.

Alias /nagios/ /usr/local/nagios/share/
<Directory “/usr/local/nagios/share”>
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all

I know it’s not much different, but it is different! So please make the correction and restart httpd.

LMAO you could die troubleshooting this kinda problem then you will just realize that you just lack one slash. I had this problem before.Kinda silly but hey, jak is right it is different. Careful with the configs.

When you make changes in configuration file you need to restart the the daemons so your changes take effect. =)

not being a cry baby or any thing but I did copy and paste, had it just like you did, even tried it again since you posted but still not working. Is there something apart from the httpd.conf file that needs to be changed?

How could you have it like I did? Your first post clearly shows that the syntax is not the same. Please explain. Just in case you didn’t notice, your httpd.conf paste is NOT the same as mine that I pasted. Are you not seeing the difference?

scriptAlias /nagios/cgi-bin /usr/local/nagios/sbin Does not equal scriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/

<Directory “/usr/local/nagios/sbin”> Does not equal <Directory “/usr/local/nagios/sbin/”>

Plus others.
Edited Sat Jul 16 2005, 05:02AM ]

Either way, you really should provide more info that just localhost/nagios is not working. There are apache logs that might be of some help to us and also, what does not working mean? Page not found, access denied, what?

what I mean is, I had it the you posted originally, it was during my making changes trying to make it right, that I ended up with what I posted. Anyhow it’s back to the original now. I get "(404 )Not found the requested url /nagios was not found on this server. And my apache logs says nothing as it relates to me trying to access a page (nagios) that isn’t present

the apache error log HAS to be reporting something.
tail -f /etc/httpd/logs/error_log

url localhost/nagio/
Page not found error in browser.
File does not exist: /var/www/html/nagio From the apache error log.

Try it.

[Mon Jul 18 11:31:28 2005] [error] [client 127.0.0.1] File does not exist: /var/www/html/nagios
[Mon Jul 18 11:31:44 2005] [error] [client 127.0.0.1] File does not exist: /var/www/html/nagios
[Mon Jul 18 14:28:12 2005] [notice] caught SIGTERM, shutting down
[Mon Jul 18 14:28:13 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/apache2-suexec)
[Mon Jul 18 14:28:13 2005] [notice] Digest: generating secret for digest authentication …
[Mon Jul 18 14:28:13 2005] [notice] Digest: done
[Mon Jul 18 14:28:13 2005] [notice] Apache-AdvancedExtranetServer/2.0.50 (Mandrakelinux/5mdk) mod_ssl/2.0.50 OpenSSL/0.9.7d PHP/4.3.8 configured – resuming normal operations
[Mon Jul 18 14:28:52 2005] [error] [client 127.0.0.1] File does not exist: /var/www/html/nagios
[Mon Jul 18 14:29:13 2005] [error] [client 127.0.0.1] File does not exist: /var/www/html/nagios
[Mon Jul 18 14:29:24 2005] [error] [client 127.0.0.1] File does not exist: /var/www/html/nagios

which is true /var/www/html/nagios doesn’t exit but why is it searching there for it?

Edited Mon Jul 18 2005, 12:31PM ]

Because you didn’t setup the web correctly. Your apache doc root is /var/www/html
So if you didn’t make an alias, then it assumes that
localhost/nagios
will be located off of document root i.e /var/www/html

Follow the instructions at
nagios.sourceforge.net/docs/1_0/installweb.html
to the letter, and you won’t have that problem any longer.

There must be something you did wrong in changing that httpd.conf that isn’t right.

ls -la /etc/httpd/conf.d/
total 104
drwxr-xr-x 2 root root 4096 Jul 9 12:28 .
drwxr-xr-x 4 root root 4096 Jun 17 10:53 …
-rw-r–r-- 1 root root 707 Feb 21 14:32 auth_kerb.conf
-rw-r–r-- 1 root root 517 Feb 21 14:32 authz_ldap.conf
-rw-r–r-- 1 root root 778 Apr 11 12:39 manual.conf
-rw-r–r-- 1 root root 330 Feb 21 15:26 mrtg.conf
-rw-r–r-- 1 root root 620 Jun 27 16:53 nagios.conf
-rw-r–r-- 1 root root 190 Jun 25 15:59 nagiostat.conf
-rw-r–r-- 1 root root 1827 Feb 21 12:19 perl.conf
-rw-r–r-- 1 root root 448 Jul 7 16:42 php.conf
-rw-r–r-- 1 root root 1438 Feb 21 23:39 python.conf
-rw-r–r-- 1 root root 392 Apr 11 12:39 README
-rw-r–r-- 1 root root 10919 Apr 11 12:39 ssl.conf
-rw-r–r-- 1 root root 352 Feb 21 11:29 webalizer.conf
-rw-r–r-- 1 root root 299 Apr 11 12:39 welcome.conf

more /etc/httpd/conf.d/nagios.conf
ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/
<Directory “/usr/local/nagios/sbin/”>
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all

Alias /nagios/ /usr/local/nagios/share/
<Directory “/usr/local/nagios/share”>
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all

#<Directory /usr/local/nagios/sbin>

AllowOverride AuthConfig

order allow,deny

allow from all

Options ExecCGI

#

#<Directory /usr/local/nagios/share>

AllowOverride AuthConfig

order allow,deny

allow from all

#

view /etc/httpd/conf/httpd.conf

Load config files from the config directory “/etc/httpd/conf.d”.

Include conf.d/*.conf

If you have the last part in your httpd.conf, then it will load all files in conf.d/*.conf

you must have told httpd to do so somewhere. :slight_smile:
Are you sure you are modifying the correct files?

Luca

can the file have a name different from httpd.conf as that which comes with the apache server.

ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/
<Directory “/usr/local/nagios/sbin/”>
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all

Alias /nagios/ /usr/local/nagios/share/
<Directory “/usr/local/nagios/share”>
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all
Alias /nagios/ /usr/local/nagios/share/
<Directory “/usr/local/nagios/share”>
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all

Is there anything apart from the above that should be done? also I put it in section two of the file, right above where apache 2 has it’s script alias

I found a file /etc/httpd/conf/httpd2.conf in which the document root is set but it also says don’t change these settings unless you’re a guru. so I guess that counts me out. But anyway it’s not supposed to be changed but I know I have the alias in httpd.conf verbatim.
What does the line do grep “^User” /etc/httpd/conf/httpd.conf and what results should I expect from it I just remembered that it didn’t give me a result when I was setting up nagios.

I finally found the solution. All the time I was adjusting the wrong file. there is a httpd.conf file in the apache 2 folder, but that one is not effective. looking at is-la that jakkedup sent I realized that he had a nagios.conf file placing it in the /etc/httpd/conf.d/ directory. This is because the webserver has a file httpd2.conf with the line Include /etc/httpd/conf.d/*.conf that takes all the conf files in that directory and puts them together. So I created my own and added the scriptalias and alias to it. restarted the webserver, ran it, worked. :slight_smile: now onto my configuration files. later.

I have the same situation, can someone help us!

Nevermind, I found the correct httpd.conf and now is working!