We help IT Professionals succeed at work.

Need help to set environment variables

isitdev
isitdev asked
on
Medium Priority
1,656 Views
Last Modified: 2013-12-16
Hi,

       We have a custom application running on our RHEL 4 machines. The app works with apache 2.2. What i am trying to do is set the environment variable for the application at boot. As of yet i have only been able to get them to work for root users.  As well using the envvars file, it does work when using the apachectl script, but only for root users. If you try to start apache using sudo, it doesnt load them.

I need these variable to load for every user and to be loaded when using httpd to start/stop apache.
I hope my question isn't to confusing, without seeing what the actual issue is.
Comment
Watch Question

Pétur Ingi EgilssonSoftware Engineer -- Consultant

Commented:
#Add this to the end of your /etc/profile
#this will add /your/path to PATH of every user.

PATH=$PATH:/your/path
export PATH

Author

Commented:
I have tried this but the paths use variables. as shown below. I'd like these to be set system wide at boot.

NETE_WA_ROOT=/apps/siteminder/webagent
export NETE_WA_ROOT
NETE_WA_PATH=${NETE_WA_ROOT}/bin
export NETE_WA_PATH

LD_LIBRARY_PATH=${NETE_WA_ROOT}/bin:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

PATH=${NETE_WA_PATH}:${PATH}
export PATH
Software Engineer -- Consultant
Commented:
Have you tired to add all that to the bottom of your /etc/profile ? ( note: /etc/profile is for non-root users only )
Pétur Ingi EgilssonSoftware Engineer -- Consultant

Commented:
So it worked?

Explore More ContentExplore courses, solutions, and other research materials related to this topic.