1753523 Members
11010 Online
108795 Solutions
New Discussion юеВ

Apache CGI problem

 
SOLVED
Go to solution
kel28_1
Occasional Advisor

Apache CGI problem

I installed Nagios from the iexpress package and configured and started it. Modified the apache httpd.conf to include the nagios share and cgi location. When trying to run a cgi from apache, I get file not found even though the apache config has been updated. Here's my apache config. Anyone had a similar problem with apache on hp-ux? Thanks.

ScriptAlias /nagios/cgi-bin "/opt/iexpress/nagios/sbin"

Options ExecCGI
AllowOverride AuthConfig
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /opt/iexpress/nagios/htpasswd.users
Require valid-user

4 REPLIES 4
gmadhu
New Member
Solution

Re: Apache CGI problem

We need to restart apache after changing the configuration file, which I know you would have already done.
Verify permissions for the directory to the apache user are fine.
The url used for accessing should be http:///nagios/cgi-bin/
Still if you see the same error, please copy paste the message from the error_log.

kel28_1
Occasional Advisor

Re: Apache CGI problem

Gmadhu, thanks for your reply. If I put in the server:/nagios/cgi-bin/tac.cgi to run the tac.cgi, it works fine. If I try to launch from the side.html panel, the correct url shows up on the bottom of the screen, but doesn't launch. There are no errors in error_log.
kel28_1
Occasional Advisor

Re: Apache CGI problem

Gmadhu, thanks for pointing me in the right direction. The problem was in the side.html configuration, wrong path. The problem is solved by pointing the cgi's to the correct path.
Ralph Grothe
Honored Contributor

Re: Apache CGI problem

Unless you change vital directives which effect memory allocation, such as StartServers, MaxClients etc. or mod_perl stuff
you do not need to fully restart your webserver after changes to httpd.conf.
It suffices to send the parent proc/thread a SIGUSR1 to have it gracefully reinitialize without your clients noticing, like e.g.

kill -USR1 $(UNIX95= ps -C httpd -o pid= -o ppid=|awk '$2==1{print$1}')

When you install your Nagios server there will be provided a preconfigured stub file with containers especially for Nagios' web interface, which you simply need to copy into e.g. ServerRoot/conf.d/nagios.conf
Then you only need to put an Include directive in your httpd.conf

Include conf.d/nagios.conf

This reduces the clutter and keeps special Nagios settings in a separate file.

The referred to dirs within the tags need to be r-x for the user/group your webserver runs as.

Also note to set the Order and AllowFrom directives correctly.
According to mod_auth's doc Apache does a
three-pass according to what the Order is set to.
I.e. if you have

Order allow,deny

Apache will first evaluate all Allow from directives.
Then in the second pass all Deny froms.
Finally if no rule matched so far the third pass sets deny as default rule.
This is in contrast to how most firewall rules are evaluated where the first match usually exits the chain.

Always refer to Apache's logs/error_log
if something isn't working.
Chances are that there will be an explanatory error message.
Madness, thy name is system administration