Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2009 15:24:12 +0300
From:      Valentin Bud <valentin.bud@gmail.com>
To:        Pieter Donche <Pieter.Donche@ua.ac.be>
Cc:        Robert Huff <roberthuff@rcn.com>, "mail.list freebsd-questions" <freebsd-questions@freebsd.org>
Subject:   Re: path for user www
Message-ID:  <139b44430906150524i70940c6dp2fbc8c22ffd9e55@mail.gmail.com>
In-Reply-To: <alpine.BSF.2.00.0906151404040.38025@macos.cmi.ua.ac.be>
References:  <alpine.BSF.2.00.0906151131390.34405@macos.cmi.ua.ac.be>  <18998.13606.129658.46433@jerusalem.litteratus.org> <alpine.BSF.2.00.0906151404040.38025@macos.cmi.ua.ac.be>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jun 15, 2009 at 3:16 PM, Pieter Donche <Pieter.Donche@ua.ac.be>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?139b44430906150524i70940c6dp2fbc8c22ffd9e55>