I double checked, apache is capable to access the directory, and red all
dirs:
tamer@office
/storage/PyENV/lin/UKDMindMapper/lib/python2.7/site-packages $ ls -lA
insgesamt 32
-rw-r--r-- 1 tamer tamer 412 22. Mai 00:23 easy-install.pth
drwxr-xr-x 4 tamer tamer 4096 22. Mai 00:21 pip-1.0.2-py2.7.egg
drwxr-xr-x 6 tamer tamer 4096 22. Mai 00:23
pymongo-2.2-py2.7-linux-x86_64.egg
drwxr-xr-x 4 tamer tamer 4096 22. Mai 00:22 pyramid-1.3.2-py2.7.egg
drwxr-xr-x 4 tamer tamer 4096 22. Mai 00:23 pyramid_jinja2-1.3-py2.7.egg
drwxr-xr-x 4 tamer tamer 4096 22. Mai 00:21 setuptools-0.6c11-py2.7.egg
drwxr-xr-x 4 tamer tamer 4096 22. Mai 00:22 zope.deprecation-4.0.0-py2.7.egg
drwxr-xr-x 4 tamer tamer 4096 22. Mai 00:22
zope.interface-4.0.0-py2.7-linux-x86_64.egg
Tamer
Am 22.05.2012 03:40, schrieb Tamer Higazi:
> Hi Graham!
> Apache can access the directories.And it but the error seems to be the
> same.... any ideas?!
>
>
> thank you for your support....
>
>
> my pyramid.wsgi file looks now:
>
> import os,sys
> os.environ['PYTHON_EGG_CACHE'] = '/tmp'
>
> print >>
> sys.stderr,os.listdir('/storage/PyENV/lin/UKDMindMapper/lib/python2.7/site-packages')
>
> from pyramid.paster import get_app
> application =
> get_app('/storage/PyProjects/UKDMindMapperApp/development.ini','main')
>
>
>
> apaches "error_log" tells me allmost the same as before:
>
>
> [Tue May 22 03:36:56 2012] [error] ['pyramid_jinja2-1.3-py2.7.egg',
> 'pip-1.0.2-py2.7.egg', 'easy-install.pth',
> 'zope.interface-4.0.0-py2.7-linux-x86_64.egg',
> 'pymongo-2.2-py2.7-linux-x86_64.egg', 'setuptools-0.6c11-py2.7.egg',
> 'pyramid-1.3.2-py2.7.egg', 'zope.deprecation-4.0.0-py2.7.egg']
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] mod_wsgi
> (pid=21318): Target WSGI script
> '/storage/PyENV/lin/UKDMindMapper/pyramid.wsgi' cannot be loaded as
> Python module.
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] mod_wsgi
> (pid=21318): Exception occurred processing WSGI script
> '/storage/PyENV/lin/UKDMindMapper/pyramid.wsgi'.
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] Traceback (most
> recent call last):
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/storage/PyENV/lin/UKDMindMapper/pyramid.wsgi", line 7, in <module>
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] application =
> get_app('/storage/PyProjects/UKDMindMapperApp/development.ini','main')
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/storage/PyENV/lin/UKDMindMapper/lib/python2.7/site-packages/pyramid-1.3.2-py2.7.egg/pyramid/paster.py",
> line 32, in get_app
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] app =
> loadapp(config_name, name=section, relative_to=here_dir)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py",
> line 247, in loadapp
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] return
> loadobj(APP, uri, name=name, **kw)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py",
> line 271, in loadobj
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1]
> global_conf=global_conf)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py",
> line 296, in loadcontext
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1]
> global_conf=global_conf)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py",
> line 320, in _loadconfig
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] return
> loader.get_context(object_type, name, global_conf)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py",
> line 454, in get_context
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] section)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py",
> line 476, in _context_from_use
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] object_type,
> name=use, global_conf=global_conf)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py",
> line 406, in get_context
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1]
> global_conf=global_conf)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py",
> line 296, in loadcontext
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1]
> global_conf=global_conf)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py",
> line 328, in _loadegg
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] return
> loader.get_context(object_type, name, global_conf)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py",
> line 620, in get_context
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] object_type,
> name=name)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py",
> line 640, in find_egg_entry_point
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1]
> pkg_resources.require(self.spec)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/distribute-0.6.21-py2.7.egg/pkg_resources.py",
> line 686, in require
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] needed =
> self.resolve(parse_requirements(requirements))
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] File
> "/usr/lib/python2.7/site-packages/distribute-0.6.21-py2.7.egg/pkg_resources.py",
> line 584, in resolve
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1] raise
> DistributionNotFound(req)
> [Tue May 22 03:36:56 2012] [error] [client 127.0.0.1]
> DistributionNotFound: UKDMindMapperApp
>
>
>
> Am 22.05.2012 03:33, schrieb Graham Dumpleton:
>> 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.