From owner-freebsd-questions@FreeBSD.ORG Mon Jun 15 12:24:34 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 D77FA106564A for ; Mon, 15 Jun 2009 12:24:34 +0000 (UTC) (envelope-from valentin.bud@gmail.com) Received: from mail-bw0-f228.google.com (mail-bw0-f228.google.com [209.85.218.228]) by mx1.freebsd.org (Postfix) with ESMTP id 34E928FC13 for ; Mon, 15 Jun 2009 12:24:32 +0000 (UTC) (envelope-from valentin.bud@gmail.com) Received: by bwz28 with SMTP id 28so555596bwz.43 for ; Mon, 15 Jun 2009 05:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=hN+cSQpO7HAC0Nx+TQp4SjK09A5PSsJ2zyzptyAugLk=; b=Zb/Pm4UYMdY+qccbdHdzcJwhyd5lg9ITS/1AwU+CtqxFx/aO8ndm+KjU3k6oWGhx2d oMQDQ+6lLsY0YYhuIaVpY4fWeSdyM/5SuR0HHJbbtQUmG6J0/otxMxvDBxHJa986u7j+ F2pLK/8MNdJMhrRnI9Ohuubxr1OIjrZdhz+CI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=C8z2SyJiZSZ6OhocRy1z/YS+7apihAUGf8LAQsBuZQrQJWM8CEPCtZx068GsDoDvsh tMb7IRvRnOl2bNt7ADgtPT2L1KrGBYxTmlf3cabXSPnrg1yrgaeoXd0BorR4aDHHlW9y nLJDPdcg9hWLrYa0JmQVcKWgewMu+hy9BzwXw= MIME-Version: 1.0 Received: by 10.103.1.5 with SMTP id d5mr3621611mui.113.1245068672140; Mon, 15 Jun 2009 05:24:32 -0700 (PDT) In-Reply-To: References: <18998.13606.129658.46433@jerusalem.litteratus.org> From: Valentin Bud Date: Mon, 15 Jun 2009 15:24:12 +0300 Message-ID: <139b44430906150524i70940c6dp2fbc8c22ffd9e55@mail.gmail.com> To: Pieter Donche Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Robert Huff , "mail.list freebsd-questions" 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 12:24:35 -0000 On Mon, Jun 15, 2009 at 3:16 PM, Pieter Donche wrote: > On Mon, 15 Jun 2009, Robert Huff wrote: > > >> Pieter Donche writes: >> >>> How can one change the PATH for the user www ? >>> to include e.g. /usr/local/bin >>> >>> In /etc/passwd the entry now is: >>> www:*:80:80:World Wide Web Owner:/nonexistent:/usr/sbin/nologin >>> >> >> Start by reading the section 5 man page for "passwd". >> Could you provide a little more detail about what's breaking >> and why you think this user's path is involved? >> Robert Huff >> > > Some users on my system run scripts in their webpages. If they specify > commands (e.g.) 'python', it is not found, unless it is specified as > '/usr/local/bin/python', since the Apache runs in an environment which > has as PATH: (as can be seen from phpinfo() output) > /sbin:/bin:/usr/sbin:/usr:bin only. > > How can one make the PATH that Apache httpd deamon will use > be a different path? and where exaclty does it get > /sbin:/bin:/usr/sbin:/usr:bin from > in the first place? > > I could try specifying in /usr/local/sbin/apachectl 's Bourne shell script: > PATH=/sbin:/bin:/usr/sbin:/usr:bin:/usr/local/sbin:/usr/local/bin > export PATH > > but wouldn't this be set back to the original at an Apache update? > > root has a better path: > > PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin > > how could I have httpd have the same path? > Hello Pieter, I guess you are looking for apache's SetEnv directive: http://httpd.apache.org/docs/1.3/mod/mod_env.html#setenv a great day, v -- network warrior since 2005