1

I am using Apache on Linux(RHEL5) and Apache version is 2.2.4. I am running a fastCGI application using Apache and I want to export a variable to this application. I have already tried SetEnv directive in the httpd.conf file but it doesn't seem to work,

Following is in the httpd.conf SetEnv MALLOC_CHECK_=3

I have also tried to set it using envvars file but still it's not exported in the application. Following is in the bin/envvars file

export MALLOC_CHECK_=3

I would like to mention that I also have the following in my httpd.conf file

<IfModule !mpm_netware_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User http
Group http
</IfModule>

and I guess that's why it's not being exported in the application i.e Apache is being initially run as root and then changes user to http so basically I have to export this variable to application as an http user. But how?

I start Apache server using:- ./bin/apachectl start (as root)

Is there a way out? I don't want to modify the code of application and use setenv system call to set an environment variable. Your help would be appreciated. Thanks for your patience.

Regards

gc

ghayalcoder
  • 131
  • 2
  • First, check the user name/id that is running apache process. Use "ps -ef | grep apache" – Khaled Nov 03 '10 at 08:31
  • You mean ps -ef | grep httpd ??? – ghayalcoder Nov 03 '10 at 09:19
  • root 5518 1 0 20:58 ? 00:00:00 /home/http/FCGI_ADSERVER/Install/Apache2/bin/httpd -k start http 5991 5518 0 21:10 ? 00:00:00 /home/http/FCGI_ADSERVER/Install/Apache2/bin/httpd -k start http 6456 5518 0 22:02 ? 00:00:00 /home/http/FCGI_ADSERVER/Install/Apache2/bin/httpd -k start – ghayalcoder Nov 03 '10 at 09:21

1 Answers1

2

Anyway, I got it

FastCgiServer -intial-env var=value

Thank you all :)

Regards

gc

ghayalcoder
  • 131
  • 2