From owner-freebsd-questions@FreeBSD.ORG Mon Jun 15 16:49:54 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55EBA106566C for ; Mon, 15 Jun 2009 16:49:54 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 08C698FC0C for ; Mon, 15 Jun 2009 16:49:53 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from smoochies.rachie.is-a-geek.net (mailhub.lan.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id A381B7E83F; Mon, 15 Jun 2009 08:49:52 -0800 (AKDT) From: Mel Flynn To: freebsd-questions@freebsd.org, Pieter Donche Date: Mon, 15 Jun 2009 08:49:38 -0800 User-Agent: KMail/1.11.4 (FreeBSD/8.0-CURRENT; KDE/4.2.4; i386; ; ) References: <139b44430906150524i70940c6dp2fbc8c22ffd9e55@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906150849.39244.mel.flynn+fbsd.questions@mailing.thruhere.net> Cc: Robert Huff , Valentin Bud Subject: Re: path for user www X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 16:49:54 -0000 On Monday 15 June 2009 06:15:11 Pieter Donche wrote: > Now I see from reading the apache start-up script /usr/local/sbin/apachectl > that one can create a file with instructions to be executed at > startup of Apache: any file in /usr/local/etc/apache22/envvars.d is > sourced into the start up environment of apache. Nope, you didn't read it right. > This directory was empty for the moment. > So I could put in there a file, > /usr/local/etc/apache22/envvars.d/mysettings > PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin > export PATH > I don't see what rules of precedence acutally apply ... > Anyone can explain me? > > And will SetEnv in /etc/httpd.conf also work at boot ??? > Or will only /usr/local/etc/apache22/envvars.d/mysettings work at boot ?? It will never work: 1) Your file needs to end in .env. 2) graceful does not restart the root process and the environment is kept in the root httpd process, thus you need to restart apache. % alias aprestart aprestart='sudo /usr/local/etc/rc.d/apache22 restart' % cat /usr/local/etc/apache22/envvars.d/path.env #!/bin/sh export PATH=/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin % aprestart Performing sanity check on apache22 configuration: Syntax OK Stopping apache22. Waiting for PIDS: 85453. Performing sanity check on apache22 configuration: Syntax OK Starting apache22. % curl -s http://localhost/info.php |sed -ne '/PATH / s,<[^>]*>,,gp' |head -1 PATH /sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin -- Mel