Questions tagged [env]
26 questions
10
votes
2 answers
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
chindit
- 195
- 1
- 1
- 3
8
votes
1 answer
Alias doesn't work in script with #!/usr/bin/env php
I've some PHP scripts which are starting with #!/usr/bin/env php. The default interpreter is PHP 4.4, but the scripts need PHP 5.3, so I created an alias in ~/.bashrc:
alias php="/usr/local/bin/php5-53LATEST-CLI"
Thus calling php -v shows me 5.3…
witrin
- 183
- 1
- 7
8
votes
1 answer
Using gpg-agent over ssh
I'm having a problem using the gpg-agent over ssh via a single command line.
Here is my configuration :
Server A : triggering the command via ssh.
ssh user@serverB "sudo -E /path/to/script.sh"
Server B : Executing the script requiring a passphrase…
Tony
- 281
- 3
- 8
7
votes
2 answers
Setting Server Variables before Apache Loads
We have CentOS with Apache running on it. Basically, I have a few variables in /etc/environment and they're passed through to our Apache configs using PassEnv. The issue is that because Apache is before /etc/environment the variables are not…
Steve Griff
- 233
- 1
- 2
- 5
6
votes
3 answers
Differences between linux and Solaris /usr/bin/env
I've a simple script:
#!/usr/bin/env perl -w
print "Hello World\n"
Make this executable, run on Linux, and I get:
/usr/bin/env: perl -w: No such file or directory
(without the -w, this works OK)
Running the same script on a Solaris 8 machine…
Tim T.
- 63
- 3
5
votes
4 answers
Why doesn't sudo -E actually preserve my environment?
I'm trying to sudo some binaries that lies in a custom path. That custom path is removed when I run sudo though, but sudo -E should preserve my path. Why doesn't it work?
$ env | egrep…
Hubro
- 1,098
- 3
- 16
- 35
5
votes
2 answers
GNU watch - how do I make it read my environment (aliases, functions, etc)
This one has been bugging me for a while: I want to use the marvelous GNU watch command to run a few custom aliases and functions that are defined in my .bashrc, but it is never able to run anything except bash built-ins or binaries.
watch -d…
Artem Russakovskii
- 973
- 3
- 11
- 25
3
votes
3 answers
Would there be anyway to know the origin account's username that ssh'ed into the server?
I initially git cloned a repo, when I push my work, within the post-receive hook, I would like to retrieve the origin acount's username who did the push.
I know $SSH_CONNECTION and $SSH_CLIENT give me the origin IP, but I can't find a way to get the…
Spredzy
- 955
- 8
- 11
3
votes
2 answers
How do you use SetEnv to read variables in Apache?
I want to set an env variable that has the DOC_ROOT info but nothing
SetEnv PROJECT_BASE %{ENV:DOC_ROOT}
SetEnv LAYOUT_HOME %{ENV:PROJECT_BASE}"/html/app/wordpress/"
and then be able to access LAYOUT_HOME in php
How can I do this? The above is…
qodeninja
- 2,723
- 10
- 31
- 33
2
votes
1 answer
How to properly use ENV variables in Nginx config?
I want to pass the RAILS_ENV env variable to nginx and use it to set the value for the rails_env directive.
I can read the value of the variable from the environment with LUA module:
location @app {
set_by_lua $env_rails_env 'return…
Jakov Sosic
- 5,157
- 3
- 22
- 33
2
votes
0 answers
Group Policy Preferences - Dynamic Environment Values
Is it possible to configure dynamic values within group policy preferences for environment variables?
I am trying to replace our old login scripts which set an env var according to the computer name.
set MYVAR=%CLIENTNAME:~-3%
Matthias Güntert
- 2,358
- 11
- 38
- 58
2
votes
1 answer
What does the - option to env do?
From the man page for env:
The historic - option has been deprecated but is still supported in this implementation.
What does the "historic - option" do?
In particular, why does it change which version of python is run?
~:$ env python
Python 2.6.5…
grifaton
- 141
- 1
- 4
1
vote
3 answers
Is there a more secure way to pass variables to a docker container than via env
I'm experimenting with docker containers. More precise, I use docker-compose. I need to pass variables to my container and use an .env file for that. While that works, it makes my wonder how secure it is. I mean every script language has access to…
moestly
- 1,138
- 8
- 10
1
vote
1 answer
Using environment variables to keep track of processes launched by cron
My question:
I have an if statement in perl where I attempt to detect via environment variables at the time of launching the perl script whether it was launched via a cron job or via normal execution through the shell.
Is there any way to set an…
perlnovice
- 11
- 1
1
vote
1 answer
ubuntu 10 add path variable for all users all the time
Where can I add to my path that it will be available for all users, all shells, all the time. In this case I want /opt/grails/bin to always be available even when being run as tomcat user from jenkins.
There are 6+ files that you can stick this in,…
orange80
- 198
- 2
- 12