View FAQ

[ Return To FAQ Index | Search The FAQs ]


FAQ Database : Nagios : Web Interface

Title:Setting SetEnv Directive in Apache to make work CGIs
FAQ ID:F0255
Submitted By:Rafael Porres Molina 
Last Updated:12/29/2005

Description:

I know I have all the right libraries installed (libgd, libpng, libjpeg, and zlib) and the CGI's were compiled, but I am still getting an error when I try to access them. The error log from Apache tells me that it can't find the gd libraries, but if I issue the command as nagios user:

ldd /usr/local/nagios/sbin/status.cgi

the shell finds them. But Apache doesn't 


Solution:

The problem is how to tell Apache to look for libraries. The SetEnv directive included in mod_env has to be used. A line as the following has to be added in httpd.conf

SetEnv LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/lib:/usr/local/lib:

Comment from Oliver Noack - On Solaris, as long as you compile the CGIs with the following Runpath-Linker Option:

LDFLAGS=-R/usr/local/lib

... all libraries will be found and there is no need to change the Apache environment with LD_LIBRARY_PATH. 


Keywords:statusmap trends histogram cgi error library libgd libpng libjpeg zlib