Skip to main content

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
9 views

Specify environment variables for grafana-a-deployment in grafana-a CR with Grafana Operator in OpenShift

With the community-provided Grafana Operator in OpenShift, how can we configure the Custom Resource (CR) grafana-a to pass environment variables (e.g. NO_PROXY and HTTPS_PROXY) to the Deployment ...
wwillfred's user avatar
1 vote
1 answer
70 views

Executing a list of commands on distinct lines with bash -c?

I pass a list of commands to a bash script through an environment variable as shown in the example below: CMDS=' date > date.txt cat date.txt date | rev ' script What is the correct ...
chmike's user avatar
  • 458
0 votes
0 answers
490 views

passing docker .env variables to nginx site configurations

from docker-compose.yml: nginx: volumes: - ./nginx/sites/:/etc/nginx/sites-available inside nginx/sites there are a bunch of .conf files for different sites. I'd like to pass variables ...
yuvi's user avatar
  • 101
0 votes
0 answers
82 views

Ansible: no password in log for community.docker.docker_container env-vars

Via ansible (AWX) I start a docker container with the community.docker.docker_container module. I have some environment variables that I dont wat to be logged. Here is a small example: - name: &...
Someone2's user avatar
  • 103
0 votes
0 answers
62 views

Where does .env (which contains the client secret) go?

I have a React app with a Node.js server. Here is the directory structure: .env app     .env     .gitignore     build/     node_modules/     package copy.json     package-lock.json     package.json    ...
BigMistake's user avatar
0 votes
0 answers
75 views

Setting a HTTP Header in ProxyPass to have dynamic route

I am setting up a request header using : RequestHeader set X_FIELD "expr=%{tolower:%{req:SOME-VAL}}" and want to send the value of this HTTP Header in ProxyPass. now I want to send the same ...
abhishek bhardwaj's user avatar
0 votes
1 answer
569 views

host not found in "$server_listen_port" of the "listen" directive

With the following nginx config excerpt: map $server_name $server_listen_port { default 443; localhost. 80; localhost 80; } server { server_name "${ENVIRONMENT_SERVER_NAME}.&...
Mr. Developerdude's user avatar
2 votes
1 answer
2k views

sourcing environment variable in bashrc: directly vs export from file yields different result - why

I am running systemd via user (i.e. enable-linger $USER) and I interact with services via systemctl --user I noticed a strange issue. Sourcing Type 1 In order for the above systemd to work for a user, ...
Newskooler's user avatar
0 votes
0 answers
127 views

I cannot get environment variable from apache

On a Centos 8, I added a SetEnv into my VirtualHost conf: <VirtualHost *:XXXX> Alias /static/ /opt/industrialisation/xxxx/xxxx/xxxx/ <Directory /opt/industrialisation/xxx/xxxx/> ...
timothepoznanski's user avatar
2 votes
1 answer
3k views

How does Windows set the %SystemRoot% variable?

The %SystemRoot% environment variable contains the path to the Windows directory. (e.g. c:\windows) SystemRoot is not configured in Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session ...
Martin's user avatar
  • 609
0 votes
1 answer
449 views

PHP exec(iptables --help) works but exec(iptables --command) doesn't work

In PHP 7.3.33 and Apache 2.4 I want to run iptables from PHP (web server enviroment) in order to block/unblock IPs, from command line, this works fine: /usr/sbin/iptables --insert INPUT --source ...
adrianTNT's user avatar
  • 1,169
2 votes
2 answers
2k views

How to pass environment variables with FreeBSD service command?

The rc.subr ${name}_env specifies this for setting environment variable: ${name}_env A list of environment variables to run command with. This will be passed as arguments to ...
Rahul Bharadwaj's user avatar
1 vote
1 answer
2k views

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: <?php echo getenv("http_proxy"); ...
peter's user avatar
  • 123
0 votes
1 answer
239 views

Getting command not found using sudo, but not for running command as root without sudo

wierd issue where if you use sudo command for certain commands it is not found. But runnning it as root user WITHOUT sudo does work root@ip-172-31-43-153:/home/ubuntu# sudo xfs_growfs -d / sudo: ...
user2958456's user avatar
2 votes
1 answer
11k views

How to create .env multiline variable

The title may be a bit confusing, so a little explanation. I need to configure an application by passing a PKCS1 PEM encoded key using environment variable. The App is configured using a .env file ...
Krystian's user avatar
  • 306
2 votes
1 answer
1k views

/etc/environment.d does not take effect on Archlinux

I believe systemd-environment-d-generator parses conf files under /etc/environment.d/. cat /etc/environment.d/60-foo.conf FOO=xxx But even after reboot, the environment variable 'FOO' does not ...
takaomag's user avatar
  • 261
1 vote
1 answer
1k views

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: <IfModule ...
Urs's user avatar
  • 115
1 vote
1 answer
293 views

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 ...
1n4ho12's user avatar
  • 13
1 vote
1 answer
4k views

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 ...
Windscale's user avatar
0 votes
1 answer
523 views

Erased System Path Variables

I was writing a batch file that was supposed to automatically set up a computer to receive "psexec" remote commads. Unluckly i didn't really pay attention to what i was writing and i wrote ...
Xcode's user avatar
  • 1
1 vote
1 answer
379 views

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 ...
Petr Gladkikh's user avatar
0 votes
1 answer
406 views

crontab: using ${USER}

I am writing some scripts that uses ${USER} to point to subsequent scripts. But when I run it from crontab, it errors out and the files are not found. I understand why. I intend to share this with my ...
SEU's user avatar
  • 101
0 votes
1 answer
2k views

Technically how do curl, ping and other tools get around an NGINX front facing reverse proxy server?

I'm having trouble understanding how communication occurs on a linux box if a front facing server like NGINX has been installed. For example this is my setup. AWS / EC2 linux based instance NGINX - ...
myNewAccount's user avatar
0 votes
0 answers
3k views

http_proxy lists port of 3128 but when I netstat that port is not open. What does this indicate?

My proxy values suggest that localhost:3128 is being used as a proxy. I should add that I personally added these environmental variables in an .sh file in my profile.d folder. A tutorial indicated I ...
myNewAccount's user avatar
0 votes
1 answer
431 views

On CentOS 8 in profile.d do I need to add my script related to environment variables to both an .sh and .csh file?

I need to add environmental variables related to proxy servers to allow my node.js app to communicate with reCAPTCHA Enterprise on Google Cloud. When I run the scripts from Accessing Google Cloud APIs ...
myNewAccount's user avatar
0 votes
0 answers
450 views

no login/no home dir user gets permission for denied (redhat8)

I am trying to solve a problem At work there is a given task where a python application is currently running on a server, this application is using a env file, which has username and password ...
vector8188's user avatar
0 votes
1 answer
9k views

java.exe in "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe" overridden local Java installation

Why and how come java.exe appeared in "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe", on Windows 10, and even more surprisingly - overridden my OpenJDK's java.exe binary,...
Giorgi Tsiklauri's user avatar
1 vote
2 answers
567 views

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 ...
user avatar
1 vote
1 answer
6k views

Setting environment variable for a different user in windows

There are tons of examples on the web how to set an environment variable for the current user. Is it possible to set an environment variable in windows for a different user (that does not have login ...
arthur's user avatar
  • 187
0 votes
1 answer
2k views

Python throws KeyError when exporting environment variables

I have a weird case where i have a secret.env file where i set all my environment variables as such: secret.env export TWITTER_CONSUMER_KEY="something" export TWITTER_CONSUMER_SECRET="...
Mervin Hemaraju's user avatar
2 votes
3 answers
3k views

Using ENV variables in Postfix and Dovecot configuration files

I'm trying to dockerize my mailing server and I'm having some troubles regarding how am I supposed to use environment variables inside Postfix and Dovecot configuration files (I'm using the latest ...
Jose's user avatar
  • 29
0 votes
2 answers
1k views

gammu 1.42, gammu-smsd service error, LD_LIBRARY_PATH not found

I'm trying install Gammu 1.42 to serve my SMS gateway on Centos 8. make, make test, make install works fine. LD_LIBRARY_PATH configured in /etc/profile as: ...... LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/...
cidy.long's user avatar
  • 101
1 vote
1 answer
716 views

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 - ...
sevzas's user avatar
  • 233
0 votes
0 answers
209 views

Process getting different environment variables to system settings

I have an issue where a tomcat process started through salt stack is getting different environment variables than the ones set on the system. This is on a centos 7 server. Below is the locale -v ...
a.smith's user avatar
  • 111
2 votes
0 answers
3k views

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 ...
pavel.sheiman's user avatar
1 vote
0 answers
109 views

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 ...
Kolyunya's user avatar
  • 217
1 vote
1 answer
1k views

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 ...
NOYB's user avatar
  • 201
0 votes
0 answers
604 views

How can I add a library search path to an executable running with a capability?

I have an application that needs to run with the CAP_NET_BIND_SERVICE capability so that it can open a low port (502 for a TCP/Modbus server). It comes bundled with a set of .so files that it needs to ...
user583054's user avatar
0 votes
2 answers
832 views

How to set a tmp env variable from inside a bash script

I have a simple bash script: #!/bin/bash export MONGOMS_DOWNLOAD_URL="https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.2.8.tgz" export MONGOMS_VERSION="4.2.8" ...
John's user avatar
  • 907
0 votes
1 answer
87 views

How do I set enviromental varialbes for my ubuntu server?

I have a ubuntu server deployed at digitalocean with gunicorn and nginx to host my django project. Now I want to save my secret key in an env. var. . I searched in the internet and I found that I have ...
Sven's user avatar
  • 135
3 votes
1 answer
5k views

Using IfDefine with environment variables

I am trying to make my configuration as flexible and easy-to-configure as possible by using a list of variables in /etc/sysconfig and loading the environment variables when Apache is started using a ...
user48147's user avatar
  • 223
-1 votes
1 answer
611 views

How can I fix the error Undefined variable: _ENV in /home/nginx/domains/mydomain.com/system/Config/BaseConfig.php?

I am trying to install a Codeigniter application in pure NGINX + PHP-FPM environment but it was previously developed in apache . After adding all the proper rules to Nginx in order to work with ...
Optimus Servers's user avatar
0 votes
1 answer
10k views

How to interpolate Jenkins environment variables inside Dockerfile?

I have a Jenkins pipeline, One of the stages of the pipeline is to build the artifact from a java application code. The artifact always get the name hello-world-${BUILD_ID}.war using BUILD_ID jenkins ...
Sara Ben Shabbat's user avatar
1 vote
1 answer
805 views

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' <path for service>, all ...
code9016's user avatar
2 votes
0 answers
183 views

How to auto init direnv on Google Cloud Shell?

my .bashrc has these lines at the bottom: if [ -f $HOME/tools/bashrc ]; then source $HOME/tools/bashrc fi and $HOME/tools/bashrc has this code at the bottom: eval "$(pyenv init -)" pyenv ...
Noel Pure's user avatar
  • 121
0 votes
2 answers
2k views

Where to Unset or change $_SERVER['LD_LIBRARY_PATH']?

I have an Apache 2.4 proxying to PHP7.4.4 php-fpm and I am trying to hide or unset the $_SERVER['LD_LIBRARY_PATH'] variable. How do I change or get rid of this variable $_SERVER['LD_LIBRARY_PATH'] in ...
user2176499's user avatar
0 votes
1 answer
972 views

Are /etc/profile.d scripts always executed on server boot?

I have a GCP instance with Ubuntu 18.04, and I'm using GCP secret manager to pull down secrets at boot time with a script in /etc/profile.d, that way I can setup system-wide environment variables that ...
TechOcean201's user avatar
0 votes
1 answer
267 views

Where is $TERM set in Linux

Specifically Ubuntu 16.04 but is there a general way it is set? The reason I ask is that I have several Ubuntu 16.04 installations (VMs on kvm/libvirt/qemu) where nothing specific was done to set ...
Senior Geek's user avatar
2 votes
0 answers
1k views

Need to Pass Environment Variables Through Apache Proxy

BACKEND: I have Tomcat connected to Apache and JKMount'ed to webapps.demo.example.com. FRONTEND: The primary VirtualHost is setup for demo.example.com. I have one application Proxy'd to BACKEND. ...
Dorothy's user avatar
  • 179
1 vote
1 answer
3k views

Grafana - Config overridden from Environment variable

I'm trying to follow Configure with environment variables / root_url # grep GF_ROOT_URL docker-compose.override.yml - GF_ROOT_URL=https://g.x.com/ # yet, when I invite ...
alexus's user avatar
  • 13.6k

1
2 3 4 5
9