From owner-freebsd-questions@FreeBSD.ORG Mon Jun 15 12:16:55 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 128CC1065701 for ; Mon, 15 Jun 2009 12:16:55 +0000 (UTC) (envelope-from Pieter.Donche@ua.ac.be) Received: from macos.cmi.ua.ac.be (macos.cmi.ua.ac.be [143.129.75.1]) by mx1.freebsd.org (Postfix) with ESMTP id 996BE8FC13 for ; Mon, 15 Jun 2009 12:16:54 +0000 (UTC) (envelope-from Pieter.Donche@ua.ac.be) Received: from macos.cmi.ua.ac.be (localhost [127.0.0.1]) by macos.cmi.ua.ac.be (8.14.3/8.14.3) with ESMTP id n5FCGpLV038371; Mon, 15 Jun 2009 14:16:51 +0200 (CEST) (envelope-from Pieter.Donche@ua.ac.be) Received: from localhost (pdon@localhost) by macos.cmi.ua.ac.be (8.14.3/8.14.3/Submit) with ESMTP id n5FCGp45038368; Mon, 15 Jun 2009 14:16:51 +0200 (CEST) (envelope-from Pieter.Donche@ua.ac.be) X-Authentication-Warning: macos.cmi.ua.ac.be: pdon owned process doing -bs Date: Mon, 15 Jun 2009 14:16:51 +0200 (CEST) From: Pieter Donche X-X-Sender: pdon@macos.cmi.ua.ac.be To: Robert Huff In-Reply-To: <18998.13606.129658.46433@jerusalem.litteratus.org> Message-ID: References: <18998.13606.129658.46433@jerusalem.litteratus.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: "mail.list freebsd-questions" Subject: Re: path for user www X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Pieter Donche List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 12:16:55 -0000 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?