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
1answer
19 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 ...
1
vote
1answer
83 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 ...
0
votes
0answers
7 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 ...
0
votes
0answers
9 views

Is there an upstart option to forward an environment variable of PID1? Similiar to PassEnvironment in systemd?

For LXC containers managed with LXD, if you pass environment options to the lxc container, many init systems don't propagate them to the children, like upstart and systemd. In systemd I can obtain ...
0
votes
2answers
98 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 ...
0
votes
1answer
58 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 ...
0
votes
1answer
24 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 ...
0
votes
0answers
15 views

How to use cinder command even set environment for it?

I have set environment for openstack: cat ~/.openstack/openrc.sh export OS_CLOUD=mycloud export OS_USERNAME=myuser export OS_PASSWORD=mypass Define OS_CLOUD as: mycloud: identity_api_version: ...
0
votes
0answers
18 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. ...
0
votes
0answers
28 views

Is it possible to use a regex or a wordlist from an environment variable in an Apache 2.4 string comparison?

In Apache 2.4 we can use an environment variable in a simple string comparison expression, for example, assuming SOME_HOST_NAME is an environment variable: <If "%{HTTP_HOST} == env('SOME_HOST_NAME'...
0
votes
1answer
149 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 ...
0
votes
1answer
23 views

Environment variables within docker images

My goal is to use environment variables in the docker-compose.yml file that can be referenced inside the application itself like in config/database.yml docker-compose.yml ... environment: $DB_NAME:...
0
votes
0answers
29 views

Can I use environement variable as domain name in Nginx? [duplicate]

OS: Debian 10.2 Hi, I wonder if it's possible to use environment variable as domain name in Nginx. I've tried to set one using export VARNAME but it didn't worked for me.
1
vote
1answer
82 views

Within FreeBSD jail – setting global environment vars

I need to set a systemwide environment variable (i.e. NODE_ENV=production) in a FreeBSD jail. I did try setting it in /etc/profile, but when I sourced it root@www:/ # source /etc/profile I got ...
0
votes
1answer
83 views

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'...
0
votes
1answer
107 views

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 ...
0
votes
0answers
21 views

Default $PATH for sh on Ubuntu (AWS EC2)

On my AWS server (running Ubuntu 18) I noticed that when I use PHP to run a shell script the value of $PATH, or other environment variables, is not what I expect. I installed a new software (Stata) ...
0
votes
1answer
35 views

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 ...
1
vote
0answers
228 views

SSH: Behavior of SetEnv for TERM variable

I want to set the TERM environment variable to a different value for each of my remote machines, so i used SetEnv TERM=myTermForRemoteVar in ~/.ssh/config. The remote machine still sees TERM=...
0
votes
2answers
322 views

Unable to export service account key in Terraform #GCP

I have downloaded the GCP service account key to my local system. In Terraform, I have set the GOOGLE_APPLICATION_CREDENTIALS as a path to this file in the startup-script part of my bastion instance. ...
0
votes
1answer
282 views

How to set the “ASPNETCORE_ENVIRONMENT” environmentVariable in the WEBROOT (web.config) with APPCMD.exe?

How am I able to set the sites web.config "ASPNETCORE_ENVIRONMENT" environmentVariable with APPCMD.exe? So far I've tried ending it using /commit:MACHINE/WEBROOT, /commit:webroot and I get the below: ...
1
vote
0answers
64 views

Permanently load environment variable on aws ssm login in windows PowerShell

I am using ssm login for logging into my windows server 2016 data center edition. When I make a RDP connection and run PowerShell from RDP, All the system environment variables are loded correctly ...
0
votes
0answers
188 views

How to increase the Java Memory in Windows Server 2016 R2?

I am trying to follow This Link to increase the memory that is available to the Java Runtime Environment, becase I encountered the "insurfficient memory for the Java Runtime Environment to continue" ...
-1
votes
1answer
191 views

Can multiple nginx statements be on the same line in a config file?

The Problem I'm creating a docker image which dynamically creates nginx config based on environment variables. I would like to minimise the number of environment variables required. I have a config ...
1
vote
1answer
88 views

How can I make an environment variable visible to a script placed in /etc/cron.daily?

Say I have a script named "mydailyscript" containing the following: #!/bin/bash if [ ! -z $MYDAILYLOG]; then exec 1>$MYDAILYLOG fi echo This script ran on $(date) and I then copy this script to /...
2
votes
1answer
2k views

Setting Apache Tomcat JRE_HOME without setting environment variable

I have a server which uses Java 6 for an Oracle implementation. But I want to install a Tomcat Apache Server on it but with Java 8. So in order to not mix the system environment here's what I want to ...
0
votes
1answer
2k views

Pass variable in remote SSH-command in Jenkins-job

i have a little test job: touch 22.txt echo "wwe" > 22.txt test=$(echo ${BUILD_NUMBER}) echo $test ssh jenkins@srv1 "mkdir D:\myfolder\$test" ssh jenkins@srv1 "dir D:\myfolder\" BUILD_NUMBER ...
-2
votes
3answers
46 views

See someone unused environment variable [closed]

Let's say I log in as Bob to host server. Then i do : export MYSEC='secret' Let's say Alice has access to the same host and also sudo permissions. How can Alice see the value of MYSEC? Note : let'...
1
vote
1answer
25 views

Task under SYSTEM won't run Win Srv 2k8R2

My company has a software that updates our installers on clients' servers. During the setup, a environment variable is created along with a task with the following lines: Variable: setx ccloud "C:\...
0
votes
0answers
21 views

What is the best approach to storing and deploying environment variable files to Node.js if they are excluded from version control?

Firstly a tiny bit of background: I have a MEAN stack application running on Bitnami Ubuntu, on AWS. I have a .env file with API keys etc in it, that is excluded from my repo using .gitignore. I ...
-1
votes
1answer
202 views

Can't change global PATH environment in ubuntu 18.04

I tried editing /etc/environment, changed it by removing games and adding my swift installation location, so now it looks like: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/...
0
votes
1answer
905 views

Set an Environment Variable in both Apache and System

I'd like to set an environment variable in both system and httpd. I set the variable, let's say IMPORTANT_FOLDER = /MY/PATH, in /etc/profile and it works for all system users. What i want to do is ...
0
votes
1answer
602 views

Issue in setting env Variable for Supervisor debian

I am using supervisorctl for running a program and environment variables to store the common variables. For setting Environment Variable I am using /etc/environment. I have added the following as ...
0
votes
1answer
25 views

How to adjust the format of Win System Environmental variables “%date%”

I have a computer running Window Server 2008 R2 Standard. It runs several periodic tasks written by Windows cmd. Recently these batch jobs work improperly and i realize that the logic of the script ...
2
votes
0answers
1k views

Using Environment variable in proxy_pass nginx

I have nginx container where I want to forward an api call to another server. I want to pass in environment variables from Docker Compose to be able to change sites, without rebuilding the Docker ...
0
votes
1answer
311 views

Systemd service for a ruby rake job and environmental variables

I have many environmental variables that are required to run my ruby rake job. This job will be supervised by systemd. How can I export all the environmental variables? And also export them in such ...
-3
votes
1answer
49 views

searching file for last matching line, then put 3rd word of this line into a variable

i have a logfile, a script checks this log-file every hour it shall pack the 3rd word of the last matching line into a variable but i didn't manage it to work yet .. logfile: 2018-11-18 22:27:10 ...
0
votes
1answer
23 views

What are the rules regarding casing of values for environment variable USERNAME in Windows?

One of my customers says that in his AD usernames have mixed case sometimes and besides that, that people are able to successfully login using another casing of usernames. So there might be an ...
0
votes
2answers
2k views

CloudFormation: How to export bash variable in the userdata so the vars would be available when the instance starts?

I wrote the following CloudFormation template: { "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "company - LaunchConfiguration and AutoScalingGroup Template", "Parameters" : { ...
3
votes
1answer
342 views

PowerShell: Format and sort environment variables

Using PowerShell I can get all (current process) environment variables and format and sort them: gci env: | %{"{0}={1}" -f $_.Name,$_.Value} | sort which gives: a=foo b=bar c=baz But that gives ...
4
votes
2answers
6k views

Getting environment variables in PHP-FPM with Nginx

I've defined some environment variables like APP_ENV in my /etc/environment file, on my ArchLinux. If I type printenv, I see them. I've created this simple test file called… test.php <?php ...
0
votes
0answers
87 views

How to restrict outbound ssh username credential to current user only

Is there a method to disallow a user from changing their outbound ssh credentials? I.e. restrict ssh -l username ip.address or ssh username@ip.address Further clarification. Only allow the username ...
0
votes
1answer
59 views

Is it fine if an external program edit the sudoers file?

My program needs some local environment variables while running as root to perform certain tasks. Would it be fine to write a subroutine that can change users sudoers to keep these variables? It's not ...
2
votes
0answers
808 views

How to escape/quote a dollar sign `$` in an env var in a php-fpm pool?

As symfony4 uses dotenv and environment variables for configuration, they are also needed on the server. to pass the variables it is possible to add the following to the pool config: example-pool....
7
votes
1answer
3k views

Cron job running a Django Python command through a virtual environment not working

I have a crontab file supposedly executing a Django command after loading the project virtual environment: */1 * * * * source /home/virtualenvs/mydjangoproject-venv/bin/activate && python /...
1
vote
3answers
9k views

Apache Custom Header with an environment variable

I try to set a custom HTTP Header with an environment variable** with Apache server 2.4.6 and headers_module. I work inside a HTTP VHost on port 80. Everything work as expected with basic example ...
0
votes
2answers
389 views

Call app with sudo and custom environment variable

I need to call sqlplus with oracle user sudo to clearly specified DB (env var ORACLE_SID) by one line command. The usual way to do it consists of 2 steps: $ sudo -u oracle -i $ ORACLE_SID=DBNAME ...
2
votes
1answer
1k views

Passing inner quotes from EnvironmentFile variable to ExecStart

In the EnvironmentFile I have: EBUSD_OPTS="--scanconfig -d /dev/ttyEBUS -c /etc/ebusd --log=\"all notice\" --log=\"update error\"" In the .service file: EnvironmentFile=-/etc/default/ebusd ...
0
votes
1answer
1k views

Apache 2.4: Set user dependent environment variable

I just wondered if it's possible to set an environment variable depending on the basic authentication user. I tried the following versions, but none of them work (obviously none of them is documented ...
2
votes
1answer
9k views

apache get environment variable value

I would like to get the value of a environment variable and assign it to another variable in Apache. For example, get the value of $_SERVER['REMOTE_ADDR'] assign it to $_SERVER['USER-IP'] and ...

1
2 3 4 5
8