Marco,

If you don't mind changing your apache2 init script, you can just add those
lines to it:

APACHE_ENVVARS=$APACHE_CONFDIR/envvars
source $APACHE_ENVVARS

I would put those lines just bellow the line defining APACHE_CONFDIR

Then put your variables on $APACHE_CONFDIR/envvars:

export LD_LIBRARY_PATH=/opt/oracle/instantclient_10_2:$LD_LIBRARY_PATH
export TNS_ADMIN=/opt/oracle/network/admin
export ORACLE_HOME=/opt/oracle/instantclient_10_2


I changed your LD_LIBRARY_PATH to add your Oracle path to it, keeping the
current LD_LIBRARY_PATH at the end.

I hope it helps!

Mauro
http://mauro.limeiratem.com - registered Linux User: 294521
Scripture is both history, and a love letter from God.


Em 20 de abril de 2012 09:18, Marco Bosisio <[email protected]>escreveu:

> Hi Mauro,
>  the level is apache2-2.2.3-16.44.1 SLES10 SP4 : I searched for
> APACHE_ENVVARS but I didn't find it.
>
> So I tried a similar solution working on  /usr/sbin/envvars-std  (that was
> delivered with package).
>
> linux: # cat /usr/sbin/envvars-std
> .....
> # envvars-std - default environment variables for apachectl
> #
> # This file is generated from envvars-std.in
> #
> LD_LIBRARY_PATH="/usr/lib64:$LD_LIBRARY_PATH"
> LD_LIBRARY_PATH="/usr/lib64${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
> export LD_LIBRARY_PATH
> #
>
> Here I added on bottom my local setting (see my first note) and restarted
> (without success) apache2 : TNS_ADMIN=  was not exported.
>
>
>
>
> > Mauro wrote
> >I looked on my local apache2 init script and saw those lines:
>
> >if [ -z "$APACHE_ENVVARS" ] ; then
>        APACHE_ENVVARS=$APACHE_CONFDIR/envvars
>
> >So I went to /etc/apache2 (my local Apache conf dir) and there's a
> envvars
> >there. So you can edit that file and put all the vars inside it.
>
> >Mauro
> >http://mauro.limeiratem.com - registered Linux User: 294521
> >Scripture is both history, and a love letter from God.
>
>
> >Em 17 de abril de 2012 12:19, Marco Bosisio
> <[email protected]>escreveu:
>
>
> > Hi,
> >  I 'm facing this problem with apache2 running on SUSE10 SP4 zLinux.
> >
> > Every time I restart apache2, using the "service apache2 restart"
> command,
> > the following variables
> > are not set:
> >
> > LD_LIBRARY_PATH=/opt/oracle/instantclient_10_2
> > TNS_ADMIN=/opt/oracle/network/admin
> > ORACLE_HOME=/opt/oracle/instantclient_10_2
> >
> > It seems that  "service" (used in IPL phase too)  clears  environment
> > before start any process.
> >
> > Nevertheless if I restart apache2 through "/etc/init.d/apache2"   the
> > mentioned variable are properly set and everything works fine. This
> > because I've set them in /etc/profile.local so the "root" env is used.
> >
> > Any clue or hints about the configuration file and/or instruction to use
> > (export ? SetEnv ? PassEnv ?)
> > in order to have the variables properly set at every Apache2 reboot
> > through "service" command ?
> > I wouldn't modify the  "/etc/init.d/apache2"  default start script  by
> > inserting required vars into it,  but if possible by configuring
> something
> > in a "*.local"  file  or in some other file untouched when apache2 pkg
> > will be updated.
> >
> > Thanks in advance..
> >
> >        Marco Bosisio
> >
> >
> > IBM Italia S.p.A.
> > Sede Legale: Circonvallazione Idroscalo - 20090 Segrate (MI)
> > Cap. Soc. euro 347.256.998,80
> > C. F. e Reg. Imprese MI 01442240030 - Partita IVA 10914660153
> > Società con unico azionista
> > Società soggetta all?attività di direzione e coordinamento di
> > International Business Machines Corporation
> >
> > (Salvo che sia diversamente indicato sopra / Unless stated otherwise
> > above)
> >
> > ----------------------------------------------------------------------
> > For LINUX-390 subscribe / signoff / archive access instructions,
> > send email to [email protected] with the message: INFO LINUX-390 or
> > visit
> > http://www.marist.edu/htbin/wlvindex?LINUX-390
> > ----------------------------------------------------------------------
> > For more information on Linux on System z, visit
> > http://wiki.linuxvm.org/
> >
>
>
>
> Cordiali saluti  / Best regards
>
>        Marco Bosisio
>
>
>
> IBM Italia S.p.A.
> Sede Legale: Circonvallazione Idroscalo - 20090 Segrate (MI)
> Cap. Soc. euro 347.256.998,80
> C. F. e Reg. Imprese MI 01442240030 - Partita IVA 10914660153
> Società con unico azionista
> Società soggetta all?attività di direzione e coordinamento di
> International Business Machines Corporation
>
> (Salvo che sia diversamente indicato sopra / Unless stated otherwise
> above)
>
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO LINUX-390 or
> visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390
> ----------------------------------------------------------------------
> For more information on Linux on System z, visit
> http://wiki.linuxvm.org/
>

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/

Reply via email to