Web Servers on Unix and Linux - Apache: CGI application end environment variable

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > February 2005 > Apache: CGI application end environment variable





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Apache: CGI application end environment variable
blpp

2005-02-03, 2:47 am

Hello NG,

I have an Apache web server 2.0.46 running on my RedHat Enterprise
Linux 3 WS running. I want to execute an CGI application written in
c++. This application needs a correct set environment variable
(LD_LIBRARY_PATH) because it creates a Java virtual machine and
therefore needs some Java librarys from the path
/usr/java/j2re1.4.2_06/lib/i386. In order to get it work I added a
SetEnv command to the httpd.conf:

SetEnv LD_LIBRARY_PATH /usr/java/j2re1.4.2_06/lib/i386

My application runs fine and I can see the environment variable.

If my CGI application itself now calls another application via system
oder execv command this second app doesn't have the environment
variable set. Using getenv I can't see the variable ...

Does the web server prevent the correct environment variables passing
to the second app?


Regards

Mario Freimann
blpp

2005-02-04, 2:47 am

Solved the problem myself. The problem was a set "user id on
execution" bit on the second app. Because this was set the linker
ld.so didn't use the variable LD_LIBRARY_PATH and the second app
couldn't be started at all.


Regards

Mario Freimann
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com