Nagios CGI error with apache


#1

Hi there,

I did the install distribution at nagios web site : nagios.sourceforge.net/docs/2_0/installing.html

But I have a error like this:

audit(1136938157.636:33): avc: denied { execute } for pid=32349 comm="httpd" name="tac.cgi" dev=dm-0 ino=588 scontext=root:system_r:httpd_t tcontext=root:object_r:usr_t tclass=file

And browser shows Internal Server Error while running nagios’s CGI, what can I do to fix this?

CentOS 4.2 / apache2.x


#2

In your httpd.conf file, which do you define first, the script-alias for the cgi’s, or the entry for your HTML files? That impacts the way Apache parses the files, and could be giving you your error.


#3

Hi SonOfThunder,

Thank you for your reply, below is my httpd.conf settings,
I add them at the end of my httpd.conf.

I follow the instruction at
nagios.sourceforge.net/docs/2_0/installweb.html

ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin

<Directory “/usr/local/nagios/sbin”>
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

Alias /nagios /usr/local/nagios/share

<Directory “/usr/local/nagios/share”>
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user


#4

SELinux enabled?

Luca


#5

Oh, yes…
How can I disable it?


#6

I suppose that would depend on what system you’re running. I imagine that generally it would be in a system settings or network settings menu somewhere.


#7

there is a command line command… try simply "selinux"
possibly a sarch in the forum could help… i think it has been posted once or twice…

Luca


#8

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

THese lines are not suppopsed to be here…
they must be in a .htaccess file in /nagios/sbin and /nagios/share directory…


#9

They can be there, as long as he’s got the .htaccess files in the respective directories, and has them configured correctly. Bareck, did you read the section of the docs about web Authentication?

Correct me if I’m wrong, but wouldn’t he be getting a “Forbidden” error if this was really an authentication issue?

Either way, it’s probably worth a shot for you to comment out the lines pertaining to authentication (the last four lines before in both of your aliases) until you can at least get through to the web interface.


#10

[quote=“bareck”]Oh, yes…
How can I disable it?[/quote]

man setenforce