httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jez Hancock <>
Subject [users@httpd] Apache / apachectl environment sanity
Date Thu, 13 Nov 2003 17:16:40 GMT

I wanted to get some opinions on this subject before I submit a problem
report to bugzilla. My feeling is that submitting a new 'bug' to
bugzilla may not be worthwhile here, firstly because it's not actually a
bug at all and secondly because the proposed 'fix' may well break other
things.  In fact there are other reasons I can think of as well right
now ... still here goes...

The issue is with the apachectl script not starting the httpd in a clean
environment, leading to the shell environment of the user that invoked
the apachectl script being available to other apache modules (PHP for

In the case of PHP the environment of the apachectl-invoking-user
is available _by default_ in the $_ENV superglobals array.

The simple solution I'm using right now (along with many others no
doubt) is to simply add the following to my (freebsd specific) apachectl

*** /usr/local/sbin/apachectl   Thu Nov 13 06:59:05 2003
--- /usr/local/sbin/apachectl.bak       Thu Nov 13 06:58:54 2003
*** 26,32 ****
  # the path to your httpd binary, including options if necessary
- HTTPD=`echo /usr/bin/env -i $HTTPD`
  # a command that outputs a formatted text version of the HTML at the
  # url given on the command line.  Designed for lynx, however other
--- 26,31 ----

which sanitizes the httpd environment as expected.

Is it worth submitting a problem report via bugzilla for this or 
would it be too problematic?  I understand some modules do use
environment variables to operate and that 'env' is not always available
on all platforms - as such it could be a pain.


Jez Hancock
 - System Administrator / PHP Developer

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message