You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Andrew Wilson <an...@tees.elsevier.co.uk> on 1995/12/07 16:36:43 UTC
Passing ENVironment vars to httpd...
...is something that CERN can do, but apache doesn't except for the
PATH and TZ environment variables.
I've uploaded mod_env.c_0.0.1 to hyperreal.com:/httpd/incoming and
would appreciate your comments, bearing in mind that it's not optimised
at present.
Cheers,
Ay.
USING THE mod_env MODULE
mod_env has not been tested with virtual hosts yet, but seems happy if
you're running a single server. One new per-server configuration file
directive is added:
PassEnv <env> [<env>*]
eg: add the following line to httpd.conf:
PassEnv USER
The value of $USER is then visible in the environment of any
CGI-BIN/SSI code running on the server. You can't change the value of
an environment variable once the server's running (well *you* can, but the
server won't notice) instead you need to kill the server and restart it
again using:
% kill -TERM `cat logs/httpd.pid`
% setenv SOMEVAR "Foo"
% ./httpd
INSTALLING THE mod_env MODULE
1) Get a copy of apache_1.0.0 from http://www.apache.org/
2) copy mod_env.c to the apache_1.0.0/src
directory.
3) edit the bottom of the src/Configuration file adding the line:
Module env_module mod_env.o
4) Make any other changes necessary to Configuration to get Apache
running on your system
5) in the src directory type:
% ./Configure
% make
6) Try running the binary, your CGI scripts should now see the
environment variables listed in the PassEnv directive.