Received: by taz.hyperreal.com (8.6.12/8.6.5) id HAA10890; Thu, 7 Dec 1995 07:41:18 -0800 Received: from skiddaw.elsevier.co.uk by taz.hyperreal.com (8.6.12/8.6.5) with ESMTP id HAA10880; Thu, 7 Dec 1995 07:41:13 -0800 Received: from snowdon.elsevier.co.uk (snowdon.elsevier.co.uk [193.131.197.164]) by skiddaw.elsevier.co.uk (8.6.12/8.6.12) with ESMTP id PAA04819 for ; Thu, 7 Dec 1995 15:39:31 GMT Received: from tees.elsevier.co.uk (actually host tees) by snowdon with SMTP (PP); Thu, 7 Dec 1995 15:36:07 +0000 Received: by tees.elsevier.co.uk (4.1/SMI-4.1) id AA23805; Thu, 7 Dec 95 15:36:43 GMT Date: Thu, 7 Dec 95 15:36:43 GMT From: Andrew Wilson Message-Id: <9512071536.AA23805@tees.elsevier.co.uk> To: new-httpd@hyperreal.com Subject: Passing ENVironment vars to httpd... Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@apache.org ...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 [*] 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.