Questions tagged [environment-variables]

Environment variables are configuration options that can be set in a shell or other similar environments. All programs started from within the shell can read them and configure themselves.

Environment variables are key-value-pair configuration options like KEY=valueor FOO=bar. Environment variables allow you to configure a program before it gets executed and without the need to store these variables in proprietary configuration files.

They are present on all POSIX systems (Unix, Linux, BSD, Mac OS, DOS, Windows, ...). Environment variables can be set by any shell and read by nearly any programming language.

Some programming languages allow you to set Environment variables, but they only persist within the current process. You can't set them to be visible by the calling shell. So they are not useful for inter-process communication.

410 questions
0
votes
1 answer

How to override default `solr.home` in XML files under `Catalina/localhost`?

I'm trying to configure two instances of Solr on the same host and I'd like to override solr.home for each instance. I've created two files under Catalina/localhost/ as suggested in Solr Tomcat wiki: $ cat solr-prod.xml
kenorb
  • 6,499
  • 2
  • 46
  • 54
0
votes
1 answer

Read user's environment variable in php script

I'm trying to query environment variables that i have set my .bashrc file (i'm running Ubuntu 14.04) in a PHP scripts that run's under Apache server. When i query the getenv('MY_VAR_NAME') or $_ENV['MY_VAR_NAME'] while accessing the page, it seems…
Ofer Velich
  • 307
  • 1
  • 2
  • 6
0
votes
0 answers

Nginx, pass environment variables through to FPM automatically?

Is there any way when running nginx from command line to have all environment variables defined at execution automatically propagate to FPM? Ideally without having to hard-code them in any config files? I'm hoping to see if there's a solution that…
0
votes
1 answer

Composer works as root but not as a common user, why?

I have installed Composer Globally as this docs shows and it works for root user on my server CentOS 6.6 but as a normal user lets said webvm user it doesn't saying that composer is not found (see below): [webvm@webvm ~]$ sudo composer [sudo]…
ReynierPM
  • 710
  • 5
  • 14
  • 30
0
votes
1 answer

Adding python to /usr/bin/env python variable

The #!/usr/bin/env python hashbang isn't working on my Ubuntu install. I tried the following: root@x# python=/usr/bin/python root@x# PATH=$PATH:/usr/bin/python
anonymous
  • 9
  • 1
  • 2
0
votes
1 answer

Strange behavior with supervisor, gunicorn and Django

I have a really strange problem with supervisor and gunicorn. I read supervisor documentation, all the relevant blog posts, stackexchange questions but none of them solve my strange problem, and I don't even know where to look further. My supervisor…
kissgyorgy
  • 302
  • 1
  • 5
  • 16
0
votes
1 answer

Set env var for user as root

I'm on debian logged in as root and I am trying to set an env var for a specific user (not root). This is what I tried and didn't work: su - nginx -c export APP_SETTINGS='production.py' The error I got was: No directory, logging in with…
J.Zil
  • 1,123
  • 3
  • 21
  • 29
0
votes
1 answer

OpenSSH client sends environment variable it should not

I have a host that doesn't have the termcap entries for non-standard terminals and I cannot add them (policy). I use tmux which sets a terminal type to something that this device does not recognise. No issue here, worst case I can set the TERM to…
Marcin Kaminski
  • 243
  • 2
  • 10
0
votes
2 answers

Setting locale in Ubuntu 12.04 (openvz)

I have a fresh installation of Ubuntu 12.04 as virtual openVZ guest. The defined locale for LC_* in basic setup is POSIX. I'd like to change this to en_US.UTF-8. So I installed language_pack_en_base and language_pack_en, ran dpkg-reconfigure locales…
0
votes
1 answer

Apache2 PassEnv not working after reboot

I have an Ubuntu 12.04 LTS server with a vanilla apache install. In my Apache Config, I'm using PassEnv to pass an environment variable: PassEnv MY_VARIABLE MY_VARIABLE is defined in /etc/environment: MY_VARIABLE=true If I stop and start apache,…
lmanners
  • 101
  • 2
0
votes
1 answer

Processes spawned by taskset not respecting environment variables

I've run into an issue where an intel compiler generated program that I'm running with taskset has been putting its temporary files into the working directory instead of /tmp (defined by environment variable TMPDIR). If run by itself, it works…
jonesy16
  • 1
  • 1
0
votes
1 answer

How to use a common library of environment variables among different languages?

We have three main languages with which we perform system tasks: Bash, Ruby, and PHP, and Perl. Four, four main languages. We use managed environment variables to provide authorization info that automated scripts need. For example, a mysql user…
JDS
  • 2,598
  • 4
  • 30
  • 49
0
votes
2 answers

How to set a user environmental variable in .profile

I set an environmental variable for user on CentOS by simply: 1.) Logging in with the user 2.) Going to their home directory cd ~ and creating a file .profile 3.) Putting the following in the .profile file: export APP="dev" However, when I: echo…
Justin
  • 5,328
  • 19
  • 64
  • 84
0
votes
1 answer

How can I change path for xml2-config

I've already asked same question in stackoverflow.I need some more help. I’m trying to upgrade libxml2 from 2.6.26 to 2.7.7 on CentOS5.5 I installed libxml2-2.7.7 in /opt/libxml2-2.7.7/bin/ I'd already installed 2.6.26 in /usr by yum install libxml2…
0
votes
1 answer

Use $HOSTNAME in upstart script

(Can|how do) I use $HOSTNAME in an Ubuntu upstart script like this: start on started foo stop on stopped foo exec someexecutable -n "$HOSTNAME""_bb"
RickyA
  • 300
  • 1
  • 4
  • 12