modifying the webserver env variables

modifying the webserver env variables

Post by Mark Irvin » Sun, 08 Apr 2001 08:24:04



Hi,

I'm having problems running cgi scripts because my perl scripts are
generating errors and these error messagres are getting sent to the web
server before any http headers are sent. This of course causes the scripts
to fail. The errors are associated with the locale settings on the
system. The perl documentation provides a few work arounds. One is to put
set some environment variables that will turn off thess error messages,
and all will be well. I've tried it on the command line, and the errors
do disappear when the vars are set.

So with this in mind, I tried to set the environment variables of the web server
by putting them in the .profile of the httpd user. The web server runs
under this id. But this has no effect on the environment of the web
server. I have a shell script that prints the server environment
variables to the browser window, and it looks as though this .profile is
not run at all. How do I modify the environment variables of the web server. Is
this dependant on the webserver (Netscape Enterprise server) or the
operating system (aix 4.3)?

Thanks,
Mark Irvine

 
 
 

modifying the webserver env variables

Post by Christer Pal » Sun, 08 Apr 2001 10:44:29



> So with this in mind, I tried to set the environment variables of the web server
> by putting them in the .profile of the httpd user. The web server runs
> under this id. But this has no effect on the environment of the web
> server. I have a shell script that prints the server environment
> variables to the browser window, and it looks as though this .profile is
> not run at all.

That's correct. .profile is executed by ksh when a login shell is
started for a user - i.e. only when you log-in as that user or do a "su
- user".

httpd is usually started by root and then internally switches to another
user id by means of a system call. The shell is never involved in this,
so consequently there's no way that the .profile of that user will be
executed.

Quote:

> How do I modify the environment variables of the web server.

You need to set them before starting the web server, so you should
probably put them in your web server start script, if you have one.
Alternatively you can put them in /etc/environment which defines the
base environment variables for ALL processes.

Quote:> Is this dependant on the webserver (Netscape Enterprise server) or the
> operating system (aix 4.3)?

Neither...

  palm.vcf
< 1K Download

 
 
 

1. Q: How to use sh shell script to modify parent process env variables?

This should be simple, but didn't find the answer in the frequently asked questions FAQ.

I want to add/modify several environment variables in my main process.  I thought it should be simple to create a little shell script to define and export these variables; however, running the shell script only modifies the variables for that shell script's process.  How do I influence the parent process' variables with a shell script.  Any help would be greatly appreciated.  Thanks in advance.

2. Source Code for TelNet, where can I get it

3. ENV Shell Variable to Normal Variable Qn

4. nfs mount on Linux??

5. How can i load conf-variables into env-variables?

6. chmod/rm strange behaviour

7. how to set a variable that modifies itself according to another variable?

8. Dell PowerEdge 1300 compatibility

9. Env variables EDITOR

10. DISPLAY env. variable in Solaris 2.2??

11. Dynamic PS1 env variable?

12. What does env variable LANG=C_C.C mean ?

13. cron and env. variables