Questions tagged [setenv]
31 questions
4
votes
4 answers
Setting CATALINA_OPTS for tomcat6 on windows doesn’t work
(I've copied this from Stack Overflow here, after someone suggested I post the question here)
I'm trying to setup Tomcat6 to work with JMX on Windows Vista 64.
To do that I need to pass the parameters below to Tomcat6.
What I do in command prompt.…
Ben
- 181
- 1
- 1
- 8
4
votes
2 answers
OSX Server - How to set environment variable on network user login
I have a group of users on my server, "Developers", and I would like an environment variable to be set for them whenever they login.
More specifically, when anyone in this group logs in, I would like the equivalent of:
setenv ANDROID_SDK_HOME…
tmkly3
- 141
- 1
4
votes
1 answer
How to remove response header in lighttpd configuration
There is mod_setenv for adding:
setenv.add-response-header = ( "Header" => "value" )
But I can't find anything to remove response headers.
I have to be sure, that my content is not cached by mobile operator proxies. On Apache I was doing it…
grzaks
- 335
- 1
- 3
- 9
3
votes
1 answer
Blocking all users without referrer BUT allowing Googlebot/bingbot at the same time (with .htaccess)
Because of some amateur-made DDOS attack on my website, I had to deny some traffic with .htaccess which worked fine.
Unfortunately, it also blocks the googlebot/bingbot:
order allow, deny
deny from 54.
SetEnvIfNoCase Referer "^$"…
PolGraphic
- 193
- 1
- 3
- 9
3
votes
2 answers
Blocking by user-agent string in httpd.conf not effective
I'd like to block some spiders and bad bots by user-agent text string for all of my virtual hosts via httpd.conf but have yet to find success. Below are the contents of my http.conf file. Any ideas why this isn't working? env_module is…
Ferdinand.Bardamu
- 31
- 1
- 3
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
php htaccess environment variables php-fpm mod_proxy_fcgi apache 2.4
My .htaccess:
SetEnv tvar "my value"
RewriteEngine on
RewriteRule .* - [E=boostpath:normal]
My virtual host settings:
AllowOverride All
Options FollowSymLinks
Require all granted
ProxyPassMatch ^/(.*\.php(/.*)?)$…
user134840
2
votes
1 answer
How come value set by SetEnv can be changed by modifying headers in browser
I'm working with an Apache server setup where we want to use SetEnv in the vhost to define if the code is running in development, beta or production. The actual web application is running on Coldfusion 8/JRun . I've set the value in the vhost using…
Jens Wegar
- 121
- 4
2
votes
3 answers
Using Apache Environment Variables to set custom ErrorDocument
I've got a set of RewriteCond rules that test for various mobile devices and then set environment variables like "env=device:.iphone" or "env=device:.smartphone" if the useragent matches an iPhone or Android device.
I'm trying to now redirect the…
Tad
- 133
- 2
- 11
2
votes
2 answers
Apache2 - setting PERL5LIB via SetEnv under CGI
my setup is as follows: I have one Apache2 webserver running different vhosts, one vhost is for the production website, the other vhost is for a staging / preview system. Both vhosts have different DocumentRoots and also different (Perl) CGI…
j0nes
- 945
- 10
- 25
1
vote
3 answers
Apache 2: Is Referer from current Host
I have an Apache 2 with mod_setenvif. My goal is to stop all hotlinking of images in my global apache.conf. Currently that's:
SetEnvIfNoCase Referer "^http://[^/]*blogger.com/" hotlink
SetEnvIfNoCase…
BlaM
- 3,816
- 5
- 26
- 27
1
vote
1 answer
PHP + mod_fastcgi + suexec can't read vars set via SetEnv in .htaccess
We have PHP running via mod_fastcgi + suexec and it seems that PHP processes run this way don't see environment variables set via SetEnv in a .htaccess file. I checked via a perl script and a shell script (both run via mod_cgid) that SetEnv indeed…
user2845840
- 213
- 1
- 8
1
vote
1 answer
APACHE SetEnv directive (from .htaccess) not send to CGI process
I don't understand Apache2 mecanism in this scenario :
1/ In this location : var/www/cgi-bin/ (user's group rights : www-data)
i've a CGI script (php-cgi) who will execute PHP app + VAR environement version :
#!/bin/bash
# file :…
gmini
- 21
- 1
- 5
1
vote
1 answer
Apache's SetEnvIf to another variable in .htaccess
Is it possible using SetEnvIf to set a variable to the content of another variable? and if so, how?
For example
SetEnvIf defined_htaccess_var ^(.*)$ has_been_defined=%{defined_htaccess_var}
So the idea is, if inside the apache.conf or httpd conf…
owenmelbz
- 163
- 12
1
vote
0 answers
environment variables set with SetEnv not passed to PHP
I'm setting some environment variables to get from the PHP $_SERVER global variable, but it does not work. The variables are not in $_SERVER and neither in the phpinfo() output. I have all modules needed enabled and I tried all things as I can do. …
gestherhf
- 11
- 2