You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Eddy Sturg <tr...@gmail.com> on 2011/06/20 22:42:10 UTC

[users@httpd] Change $PATH in apache

Hey folks,

I'm sure this is a dumb question, but I've searched and read - all to no
avail.

httpd-2.2.3-43.el5.centos.3
CentOS release 5.5 (Final)


And I've installed the current python from source in /opt/python

We're trying to run trac and svn which include some python scripts.  I'd
really like to use the python that I've installed in /opt, but it appears
that apache is using the default python /usr/bin/python.

So, I figured I'd just edit apachctl and add something like:

PATH=/opt/python/bin:$PATH
export PATH

But, that did not work.  After doing some research, it looks like maybe I
should be doing something like the SetEnv directive in httpd.conf, is that
right?

Thanks for your help,

Eddy
---------------------

Re: [users@httpd] Change $PATH in apache

Posted by Eddy Sturg <tr...@gmail.com>.
I've tried that, it did not work.  To be clear - I'm starting apache with
the apachectl script.  As root, I've adjusted my PATH, `which python` shows
me that I'm pointing to the correct python.  Then I run apachectl start and
I still get the same error.

I guess I need to get server-info working so that I can report on what the
PATH is actually set to.  Unfortunately, I'm having a problem with that too.

I'll start a new thread since that is a different issue.

Thanks for the note, Igor.

Eddy
--------------


On Mon, Jun 20, 2011 at 7:28 PM, Igor Cicimov <ic...@gmail.com> wrote:

> Run those commands in terminal and start apache from the same terminal. To
> make it permanent add those line in the shell rc file for the user you are
> starting apache with.
>
> Igor
>
>
> On Tue, Jun 21, 2011 at 6:42 AM, Eddy Sturg <tr...@gmail.com> wrote:
>
>> Hey folks,
>>
>> I'm sure this is a dumb question, but I've searched and read - all to no
>> avail.
>>
>> httpd-2.2.3-43.el5.centos.3
>> CentOS release 5.5 (Final)
>>
>>
>> And I've installed the current python from source in /opt/python
>>
>> We're trying to run trac and svn which include some python scripts.  I'd
>> really like to use the python that I've installed in /opt, but it appears
>> that apache is using the default python /usr/bin/python.
>>
>> So, I figured I'd just edit apachctl and add something like:
>>
>> PATH=/opt/python/bin:$PATH
>> export PATH
>>
>> But, that did not work.  After doing some research, it looks like maybe I
>> should be doing something like the SetEnv directive in httpd.conf, is that
>> right?
>>
>> Thanks for your help,
>>
>> Eddy
>> ---------------------
>>
>>
>

Re: [users@httpd] Change $PATH in apache

Posted by Igor Cicimov <ic...@gmail.com>.
Run those commands in terminal and start apache from the same terminal. To
make it permanent add those line in the shell rc file for the user you are
starting apache with.

Igor

On Tue, Jun 21, 2011 at 6:42 AM, Eddy Sturg <tr...@gmail.com> wrote:

> Hey folks,
>
> I'm sure this is a dumb question, but I've searched and read - all to no
> avail.
>
> httpd-2.2.3-43.el5.centos.3
> CentOS release 5.5 (Final)
>
>
> And I've installed the current python from source in /opt/python
>
> We're trying to run trac and svn which include some python scripts.  I'd
> really like to use the python that I've installed in /opt, but it appears
> that apache is using the default python /usr/bin/python.
>
> So, I figured I'd just edit apachctl and add something like:
>
> PATH=/opt/python/bin:$PATH
> export PATH
>
> But, that did not work.  After doing some research, it looks like maybe I
> should be doing something like the SetEnv directive in httpd.conf, is that
> right?
>
> Thanks for your help,
>
> Eddy
> ---------------------
>
>

RE: [users@httpd] Change $PATH in apache

Posted by Ashwin Kesavan <as...@yahoo-inc.com>.

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com] 
Sent: Tuesday, June 21, 2011 11:42 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Change $PATH in apache

> We're trying to run trac and svn which include some python scripts.  I'd
> really like to use the python that I've installed in /opt, but it appears
> that apache is using the default python /usr/bin/python.

Using it for what? mod_python, or python scripts that start with
#!/usr/bin/python?

I wouldn't expect either cares about the PATH.
-------------END ----------------


Good point. So it won't care what the PATH variable tells. But command line will be working fine. But scripts would fail. So the way out would be to rename the /usr/bin/python to something like /usr/bin/python-<it's version number> and sym link the /opt/python to this /usr/bin/python. And it should now work fine from both cmd line and from scripts. But think twice before you do this. Because the OS scripts which rely on the ver. of python in /usr/bin/python and if your python in /opt/python is not backward compatible with /usr/bin/python then those things will fail. So I think of running sed s$usr/bin/python$/opt/python$g on all the files which are related to the trac and svn. you can find out trac and svn files via listing files via rpm or dpkg. But this sed is a long workaround and YMMV.

HTH

--ashwin

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


Re: [users@httpd] Change $PATH in apache

Posted by Eric Covener <co...@gmail.com>.
> We're trying to run trac and svn which include some python scripts.  I'd
> really like to use the python that I've installed in /opt, but it appears
> that apache is using the default python /usr/bin/python.

Using it for what? mod_python, or python scripts that start with
#!/usr/bin/python?

I wouldn't expect either cares about the PATH.

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