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
3 answers

When standing up a server (Debian for instance) what are ways to make the environment variables persistent and available to PHP?

What I am doing now at the OS level: Upon initialization, change to the user that needs the variable and export the variables then also specify setting them in the profile-- or in /etc/environment (Debian) in the case of root to account for…
BradChesney79
  • 67
  • 5
  • 12
0
votes
1 answer

ansible hash summ of vaiables

Help please, the second day can not solve the problem. I need to add checksum sha1 in file that is created from a template Example: {{ item.some_var1 | hash('sha1') }} - work fine But when I'm trying to get something like this {{ item.some_var1…
Maxim K
  • 3
  • 1
0
votes
0 answers

Duply: Dropbox backend keeps complaining about missing env variables

Good morning, I'm using duplicity/duply to backup some of my linux machines. One of the targets is a Dropbox account and the backup basically works very well. Now, I'm trying to set up an option to restore the backup on my MacBook Pro (OS-X 10.11).…
Norbert
  • 191
  • 1
  • 1
  • 4
0
votes
1 answer

Can I set environment variables in my apache conf and use them in htaccess rewrites?

We have an apache conf defining a bunch of env variables, like so: /etc/apache2/conf-enabled/env.conf SetEnv AWS_BUCKET "MY BUCKET" I would like to use that variable, AWS_BUCKET in my rewrite like so: RewriteRule ^wp-content/uploads/(.*)$…
rugbert
  • 83
  • 2
  • 10
0
votes
2 answers

!Linux standard path information, similar to windows path variables, like %AppData%, %UserProfile%, etc.?

Is there, in linux variables, or some other means to find per/system paths, similar to windows path variables, like %AppData%, %UserProfile%, %AllUsersProfile%, %ProgramFiles%, %SystemRoot%, %SystemDrive%, %Temp%, %Tmp%, etc.? Update: OK, I've found…
igoryonya
  • 195
  • 1
  • 3
  • 14
0
votes
1 answer

Adding /etc/environment makes bash fail

On RHEL 6.7, I've added the file /etc/environment: JAVA_HOME="/opt/jdk1.8.0_91" JRE_HOME="{JAVA_HOME}/jre" M2_HOME="/usr/local/apache-maven" M2="{M2_HOME}/bin" PATH="{JAVA_HOME}/bin:{JRE_HOME}/bin:{M2}:{PATH}" Now on login, bash gives the following…
Paul Croarkin
  • 193
  • 1
  • 1
  • 6
0
votes
1 answer

Danger of setting the environment variable 'PATH' with a '.'?

I have an upcoming test and looking at past years they always ask a similar question. Basically the security hole that would be created by setting something like: PATH=".:/bin:/usr/bin" I get that PATH determines the absolute directories to be…
0
votes
1 answer

Automatically increase OpenShift SSH timeout

When I SSH into my gear on OpenShift the default SSH timeout is 300 seconds, which I find too short. I can run either of the following commands in the terminal to fix this: export TMOUT=30000 unset TMOUT However, doing this on each login is a chore…
Ninjakannon
  • 101
  • 3
0
votes
0 answers

environment variable 'HOME' value on windows

I have a ruby script running in the context of a scheduled task (windows server 2012r2), running as user "Administrator". Here is the sequence of events which recreates this issue: Create an AWS AMI, which includes ruby script (which just logs…
0
votes
2 answers

Node.js executable issue

I have installed node.js from repositories (v0.10.25, Ubuntu 14.04.3, nodejs-legacy package). I need a specific version (v0.10.35) for a project. I installed n (sudo npm install -g n) and installed the needed node.js version using it (sudo n…
warvariuc
  • 358
  • 1
  • 5
  • 14
0
votes
1 answer

Restrict access dependent on environment variable

Trying to be clever and allow access depending on an environment variable. It doesn't seem to work (no errors, the expression is always false). What I tried: ... Options Indexes…
superhero
  • 151
  • 7
0
votes
0 answers

setting and working webserver environment variables

currently I'm trying to setup environment variables for Apache in CentOS 5.5 According with CentOS manual and this post they should be placed in /etc/sysconfig/httpd but doing that I get Undefined index myvar env_module is enabled so that's not the…
Néstor
  • 103
  • 1
0
votes
1 answer

How to edit environment variable in PASE without VI or NANO etc

I'm new to IBMi but am relatively familiar with UNIX like OS's. I don't have VI or NANO in PASE on IBMi, I can't seem to download and install either of them either. I found EDTF here but when I use it, it's states command not found. Is there a…
d.lanza38
  • 357
  • 1
  • 6
  • 13
0
votes
2 answers

xrdp changing PATH environment variable

All, I'm using xrdp to connect to a Centos 7 box. I notice that my PATH environment variable is different depending on whether I RDP in or SSH and I can't for the life of me figure out where that's happening. I've checked /etc/xrdp/startwm.sh but…
0
votes
0 answers

Trouble figuring out a fail2ban log error message: "iptables -n -L INPUT | grep -q 'fail2ban-SSH[ \t]' returned 100"

Here is my jail.local rule for ssh: [ssh-iptables] enabled = true filter = sshd action = iptables[name=SSH, port=ssh, protocol=tcp] logpath = /var/log/messages maxretry = 5 Here is what my log is producing with BAN 2015-04-23 07:07:49,823…
tremor
  • 143
  • 1
  • 10