Howto set Environment variables prior to web server start

Hello,

the following problem occurs on a SLES11 apache2 web server with
PHP/ORACLE modules:

In order to configure PHP/OCI8 modules, we need to set an environment
variable:
TNS_ADMIN=/etc

This helps the OCI8 module to find its configuration files.

This must be set before the web server starts.

After many failures (other options like putting it in profile.local do
NOT work),
the only working solution for us is to append the following line in
/etc/sysconfig/apache2 manually:
export TNS_ADMIN=/etc

This works fine, the apache environment is set correctly,
however, the only problem is that after the next YAST Konfiguration
warns about
overwrites and this will be lost.

Is there any other place where we can put this in safely without
hassles?

Many thanks in advance,

kind regards

stagyy


stagyy

stagyy’s Profile: http://forums.novell.com/member.php?userid=114671
View this thread: http://forums.novell.com/showthread.php?t=445090

On Wed, 21 Sep 2011 15:16:02 GMT
stagyy stagyy@no-mx.forums.novell.com wrote:
[color=blue]

Hello,

the following problem occurs on a SLES11 apache2 web server with
PHP/ORACLE modules:

In order to configure PHP/OCI8 modules, we need to set an environment
variable:
TNS_ADMIN=/etc

This helps the OCI8 module to find its configuration files.

This must be set before the web server starts.

After many failures (other options like putting it in profile.local do
NOT work),
the only working solution for us is to append the following line in
/etc/sysconfig/apache2 manually:
export TNS_ADMIN=/etc

This works fine, the apache environment is set correctly,
however, the only problem is that after the next YAST Konfiguration
warns about
overwrites and this will be lost.

Is there any other place where we can put this in safely without
hassles?

Many thanks in advance,

kind regards

stagyy

[/color]
Hi
If it works then just add the format after the last entry;


## Type:        string
## Default:     "/etc"
## ServiceRestart: apache2
#
# This variable helps the OCI8 module to find its configuration files.
#
TNS_ADMIN="/etc"

Then run the command;

SuSEconfig --module sysconfig

You should now see it appear in YaST /etc/ sysconfig editor Network →
WWW.

Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 8 days 19:53, 5 users, load average: 0.05, 0.12, 0.08
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Hello malcomlewis,

many thanks for your help.
While this works in principal, there is no effect on the module
until we explicitly add “export” to the line:

export TNS_ADMIN="/etc"

I do not know the reason, might be PHP-specific, for the moment we
will
leave it like that therefore.

Many thanks again,

kind regards

stagyy

You should now see it appear in YaST /etc/ sysconfig editor Network

WWW.

Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 8 days 19:53, 5 users, load average: 0.05, 0.12, 0.08
GPU GeForce 8600 GTS Silent - Driver Version: 280.13


stagyy

stagyy’s Profile: http://forums.novell.com/member.php?userid=114671
View this thread: http://forums.novell.com/showthread.php?t=445090