2010/1/14 sborf <[email protected]>:
>
>
> On Jan 12, 11:20 am, Graham Dumpleton <[email protected]>
> wrote:
>> For when you set WSGIPythonHome, can you look through log files for
>> line generated by:
>>
>>             ap_log_error(APLOG_MARK, WSGI_LOG_INFO(0), wsgi_server,
>>                          "mod_wsgi (pid=%d): Python home %s.", getpid(),
>>                          wsgi_server_config->python_home);
>>
>> I want to confirm that WSGIPythonHome was actually applied and what
>> you set it to. It should work just as if PATH was set.
>
> What I can found in my logs is the following, and further I could see
> the line with "Adding '/usr/local' to path" only when apache start
> from a shell where in PATH is set the python path (/usr/local/bin).
> I set the WSGIPythonHome in httpd.conf at '/usr/local'
>
> [Fri Jan 02 08:27:53 1970] [info] mod_wsgi (pid=1921): Initializing
> Python.
> [Fri Jan 02 08:27:53 1970] [info] mod_wsgi (pid=1920): Initializing
> Python.
> [Fri Jan 02 08:27:53 1970] [info] mod_wsgi (pid=1921): Attach
> interpreter ''.
> [Fri Jan 02 08:27:53 1970] [info] mod_wsgi (pid=1921): Adding '/usr/
> local/' to path.

Right value, wrong message. The message should have been:

  Python home /usr/local.

The attributes of the structure which hold a custom Python path are
next to that for a custom Python home directory.

    const char *python_home;
    const char *python_path;

I have checked the code and it isn't mistakenly using wrong one, so
something must be going wrong with structure layout in your cross
compiled code.

To try and progress things and allow you to test to see if there is
anything else wrong suggest one of the following. In both cases, you
will want to edit the 'envvars' file. This is usually in the same
directory as 'httpd' executable and is sourced by the 'apachectl'
script before executing 'httpd'. This assumes you are using a standard
ASF Apache source distribution and not one hacked by some
distribution. On Linux distributions that file doesn't usually exist
and have to hack the init.d scripts where they have custom start
wrappers instead.

Your choices for what to put in that file are:

1. Use environment variable to set Python home.

  PYTHONHOME=/usr/local
  export PYTHONHOME

2. Set PATH to include location of 'python' executable.

  PATH=/usr/local/bin:$PATH
  export PATH

Try each of these, using apachectl to start Apache.

Graham

> [Fri Jan 02 08:27:53 1970] [info] mod_wsgi (pid=1920): Attach
> interpreter ''.
>
>>
>> Also post what you get for value of 'sys.prefix' when printed out from
>> command line Python and also what you get for 'which python'.
>
> Python 2.6.2 (r262:71600, Dec 17 2009, 17:16:21)
> [GCC 4.1.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import sys
>>>> sys.prefix
> '/usr/local'
>
> mx27# which python
> mx27#
>
> I don't have anything in PATH since this is a base scratch minimal
> distro :-), I use it to do some tests... and this is because, I think,
> I need to set the PATH to the python path '/usr/local/bin' when I exec
> the httpd daemon.
>
> Maja
>
> --
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/modwsgi?hl=en.
>
>
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.


Reply via email to