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
1
vote
1 answer

How do you access an httpd.conf Environment variable in .htaccess?

This doesnt seem to work in .htacces: SetEnv FOO %{ENV:BASH}
qodeninja
  • 2,753
  • 10
  • 32
  • 33
1
vote
1 answer

Why environment variable set by SetEnv in apache httpd.conf cannot be passed to php?

I set an environment variable in httpd.conf: SetEnv http_proxy "http://localhost:3128" But I cannot get this variable in php using getenv:
peter
  • 93
  • 13
1
vote
1 answer

Condition depending on domain in .htaccess: SetEnvIf and IfDefine?

I would like to add a rule in .htaccess that "Does something" (actually enable a httpauth user restriction) depending on the domain name. I thought I had it and did: SetEnvIf Host "staging\.(.*)\.ch"…
1
vote
1 answer

How to set a proxy for terminal without exporting the environment variable?

How to set a proxy for terminal without exporting the environment variable? I am using a Ubuntu machine and I would like to do that? If it not possible, are there any apps to help me do that? Thank you.
1n4ho12
  • 13
  • 2
1
vote
1 answer

Environment variables in systemd ExecStart, ExecStop clauses not working as expected

I'm working on some unit files for some systemd services. The path prefix to some of my binaries is quite long and they are used several times in ExecStart=, ExecStartPost=, and ExecStop= clauses. I have some environment variables defined (which…
Windscale
  • 13
  • 5
1
vote
1 answer

Avoid pod environment variables' conflicts with Docker-style links

We running or components in Kubernetes with Docker as container runtime. A problem with it is that pod environment is polluted with Docker-style link variables like SERVICENAME_PORT_8181_TCP SERVICENAME_PORT_HTTP ..... SERVICENAME_PORT for each…
Petr Gladkikh
  • 183
  • 1
  • 1
  • 9
1
vote
2 answers

How do I make my PHP Source installation use the libraries inside of /usr/local/programname/lib instead or /usr/local/lib?

How do I make my PHP Source installation use the libraries inside of /usr/local/programname/lib instead or /usr/local/lib? I have tried setting LD_LIBRARY_PATH to each of the program names like…
user549144
1
vote
1 answer

NUMBER_OF_PROCESSORS env var incorrect on Dell PowerEdge Gen14 With Windows Server 2012 R2

I'm seeing that the environment variable NUMBER_OF_PROCESSORS is incorrect on my newly installed Dell PowerEdge 740xd Gen 14 running Windows Server 2012 R2 Standard. The machine contains 2 CPUs - Intel Platinum Xeon 8173M. Each CPU contains 28…
1
vote
0 answers

Apache 2.4 environment variables in config

Ok, so I'm building a docker image for apache. I want to allow users to specify custom apache config with the environment variable. TL;DR The question could be simplified to this: how to use environment variables to print part of the config (not…
pavel.sheiman
  • 11
  • 1
  • 2
1
vote
0 answers

Environment variables inside of an environment file

Background I was deploying my docker environment to a production server when I've noticed that the application would not work. For some reason the environment variables were not set correctly inside the containers. It's also important that I define…
Kolyunya
  • 217
  • 1
  • 3
  • 9
1
vote
1 answer

Can the Apache SetEnvIf Request_URI variable be decoded in Virtual Host and/or Server config context?

When the following SetEnvIf directive is in a virtual host directory section or in an .htaccess file the Request_URI variable is percent decoded. But when it is not in a directory section or .htaccess file (i.e. virtual host or server config…
NOYB
  • 191
  • 7
1
vote
1 answer

linux capabilities to read environment variables?

I'd like to run a service as a non-privileged user, but it needs to bind to a system port number (i.e. less than 1024), so I give it setcap 'cap_net_bind_service=+ep' , all good. Problem is, on startup, the service reads…
code9016
  • 21
  • 4
0
votes
1 answer

Passing environment variables to httpd in centos 7

In my previous Centos 6.10 server , I have been able to pass some environment variables to httpd by adding to /etc/sysconfig/httpd . ~/.envvars .envvars content is export MY_PASSWORD='somepassword' and then in http.conf SetEnv MY_PASSWORD…
0
votes
1 answer

How to make changes to environmental variables on Windows Server 2016 stick and stay permanent?

After setting the CLASSPATH environmental variable on Windows Server 2016 using the Control Panel/System/Advanced Settings/Environmental Variables UI Tool - the CLASSPATH value reverts back to its original value when the system is restarted. We…
0
votes
1 answer

GitLab: Global (instance-level) variables for CI builds

How can I set up global environment variables in GitLab that are not project-specific, but apply to all projects? Classic use cases are deployment keys, docker registry credentials and connect proxy information. People have been asking about it for…
uav
  • 534
  • 5
  • 20