On 22 May 2012 11:05, Tamer Higazi <[email protected]> wrote:
> Hi Graham,
> Thanks for your quick response....
>
> Am 22.05.2012 02:35, schrieb Graham Dumpleton:
>> Two possibilities.
>>
>> The Apache user doesn't have access to the virtual environment directories.
>
> drwxr-xr-x 5 tamer tamer 4096 22. Mai 00:24 UKDMindMapper
>
> should be totally accessable for apache, because world can read it's
> content.

All directories in the complete path of:

/storage/PyENV/lin/UKDMindMapper/lib/python2.7/site-packages

need to have permissions such that Apache can search into the
directories. If any parent directory is not searchable, then it will
not be able to access it.

>> Or, the package is a compressed egg and because PYTHON_EGG_CACHE is
>
> The WSGI file looks now like this:
>
> import os,sys
> os.environ['PYTHON_EGG_CACHE'] = '/tmp'
>
> from pyramid.paster import get_app
> application =
> get_app('/storage/PyProjects/UKDMindMapperApp/development.ini','main')
>
>> not set to a writable location it is failing to unpack the egg so it
>> can be used.
>>
>> The latter doesn't always result in an obvious error.
>>
>> For the first, print out sys.path in the WSGI script file to see what
>
> how do I print out the sys.path in the WSGI script, when I start apache
> and open the desired URL?!

You have done it now by the looks of it, but:

  print >> sys.stderr, 'PATH', sys.path

You could also have added:

  print >> sys.stderr,
os.listdir('/storage/PyENV/lin/UKDMindMapper/lib/python2.7/site-packages')

If that failed then Apache cannot access the directory.

The question is, where is UKDMindMapperApp normally loaded from? I
don't see anything in sys.path which specifically identifies where it
may be.

Maybe the 'ls -las' will show, but maybe you can just say.

>> it gets set to. If no sub package directories are listed from virtual
>> environment, likely it or some parent directory isn't
>> readable/searchable to Apache user.
>>
>> Graham
>>
>> On 22 May 2012 10:20, Tamer Higazi <[email protected]> wrote:
>>> Hi!
>>> I am trying to set the pythonpath for the WSGI application, and it
>>> always fails. mod_wsgi always look in the main
>>>
>>> /usr/lib/python27/site-packages folder, and I don't know why.
>>>
>>> I have set up a virtual environment and installed all packages.
>>>
>>> In the VirtualHost section I set the python path:
>>>
>>> WSGIDaemonProcess pyramid user=apache group=apache threads=4
>>> python-path=/storage/PyENV/lin/UKDMindMapper/lib/python2.7/site-packages
>>>
>>>
>>> For any advises howto tell mod_wsgi to use a differen python-path
>>> successfully, I would kindly thank you.
>>>
>>>
>>>
>>> Tamer
>>>
>
> --
> 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