Stas Bekman wrote:
Stas,Kemin Zhou wrote:
Stas,
Thaks a lot for the help. Maybe you can give me more help. When I added the two lines to my http.conf file
SetEnv LD_LIBRARY_PATH /usr/local/pgsql/lib PassEnv LD_LIBRARY_PATH
While restarting the server:
Stopping httpd: [ OK ]
Starting httpd: [Sun Oct 17 15:41:42 2004] [warn] PassEnv variable LD_LIBRARY_PATH was undefined
I read the Apache book and could not figure out what is wrong. It could be a hidden trick. It must be
something obvious that I missed.
Why SetEnv and PassEnv? It's either or, not the two together. PassEnv passes env vars from the shell if they are already set. SetEnv explicitly sets them.
So the warning tells you that the shell you start apache from doesn't have
LD_LIBRARY_PATH defined (which means that you probably not using the same environment to run your plain perl tests and modperl tests, e.g. because one is run as root and the other as another user).
So either set it in the shell you running and use PassEnv, e.g.:
LD_LIBRARY_PATH=/usr/local/pgsql/lib ./httpd
or just set it in httpd.conf:
SetEnv LD_LIBRARY_PATH /usr/local/pgsql/lib
Thaks again for the help. You solved my problem (I can take a break now). Just a add a note:
The SetEnv .. Methods works fine without much effort.
The PassEnv ... depends on the environment of the apache user. My apache server use the appache
username, and it is not a login shell. Therefore this mechanism does not seem to work. Only after
I make apache a login shell and add the .bashrc file to the home directory of apache (in my case
I used the default /usr/local/apache2). I am not sure about the security issues this may bring.
in the .bashrc file I added one line . /etc/profile ( in my case I defined the LD_LIBRARY_PATH in
the /etc/profile file). This way, when apache starts the httpd daemon, it has LD_LIBRARY_PATH
defined so that the PassEnv will not get a undefined variable.
Further info: my httpd was started with the Linux daemon shell function locaated in the /etc/init.d/function
file.
Hope these will be helpful to others.
Kemin
-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html