I need to set my apache environment to 'foobar'
I know I need to set in in my vhost, but what should I type there and where?
SetEnv DirectiveSets an internal environment variable, which is then available to Apache HTTP Server modules, and passed on to CGI scripts and SSI pages.
setenv is a built-in function of the C shell (csh). It is used to define the value of environment variables. If setenv is given no arguments, it displays all environment variables and their values. If only VAR is specified, it sets an environment variable of that name to an empty (null) value.
The most basic way to set an environment variable in Apache is using the unconditional SetEnv directive. Variables may also be passed from the environment of the shell which started the server using the PassEnv directive.
SetEnv
sets a particular variable to some value, so you need something like
SetEnv varname varvalue
If this is for a specific virtual host, and you have access to the Apache configuration files, this would go inside the <VirtualHost>
directive for that virtual host.
If you don't have control of the config files, you'll need to put it in a .htaccess
file. But for this to work, SetEnv
must be allowed in .htaccess
files, which is specified using the AllowOverride
directive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With