httpd-users mailing list archives

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

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
one).

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
script:

-snip-
*** /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=/usr/local/sbin/httpd
- 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 ----
-snip-

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.

Cheers.

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message