[Grok-dev] configuring grok with mod_wsgi

Jan-Jaap Driessen jdriessen at thehealthagency.com
Wed Jan 26 05:25:15 EST 2011


On 26 January 2011 03:23, Juan A. Diaz <jdiaz at menttes.com> wrote:
> Hi, all.
>
> I'm deploying a site with Grok and mod_wsgi (3.3) but Im getting a problem
> that I could solve.
>
> I'm using a wsgi script generated with collective.recipe.modwsgi and the
> application is working fine with paster usging the deploy.ini profile that
> I'm using with the wsgi script.
>
> The apache configuration looks like this.
> ===============================
>     WSGIDaemonProcess merlot user=zope group=zope threads=5
>     WSGIScriptAlias / /srv/grok/merlot/Merlot/parts/wsgi/wsgi
>
>     <Directory /srv/grok/merlot/Merlot>
>         WSGIProcessGroup merlot
>         WSGIPassAuthorization On
>         WSGIApplicationGroup %{GLOBAL}
>         Order deny,allow
>         Allow from all
>     </Directory>
>
>
> Here the apache log.
> ==================
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x] mod_wsgi (pid=31324):
> Target WSGI script '/srv/grok/merlot/Merlot/parts/wsgi/wsgi' cannot be
> loaded as Python module.
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x] mod_wsgi (pid=31324):
> Exception occurred processing WSGI script
> '/srv/grok/merlot/Merlot/parts/wsgi/wsgi'.
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x] Traceback (most recent
> call last):
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/parts/wsgi/wsgi", line 160, in <module>
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     application =
> loadapp("config:" + configfile)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 203, in loadapp
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     return loadobj(APP,
> uri, name=name, **kw)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 223, in loadobj
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]
> global_conf=global_conf)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 247, in loadcontext
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]
> global_conf=global_conf)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 270, in _loadconfig
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     return
> loader.get_context(object_type, name, global_conf)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 397, in get_context
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]
> global_additions=global_additions)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 492, in _pipeline_app_context
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     APP, pipeline[-1],
> global_conf)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 401, in get_context
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     section)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 423, in _context_from_use
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     object_type,
> name=use, global_conf=global_conf)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 353, in get_context
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]
> global_conf=global_conf)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 247, in loadcontext
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]
> global_conf=global_conf)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 277, in _loadegg
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     return
> loader.get_context(object_type, name, global_conf)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 553, in get_context
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     object_type,
> name=name)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py",
> line 579, in find_egg_entry_point
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]
> possible.append((entry.load(), protocol, entry.name))
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/setuptools-0.6c11-py2.6.egg/pkg_resources.py",
> line 1954, in load
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     entry =
> __import__(self.module_name, globals(),globals(), ['__name__'])
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/grokcore.startup-1.1-py2.6.egg/grokcore/startup/__init__.py",
> line 15, in <module>
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     from
> grokcore.startup.startup import (application_factory,
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/grokcore.startup-1.1-py2.6.egg/grokcore/startup/startup.py",
> line 4, in <module>
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     import zope.app.wsgi
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/zope.app.wsgi-3.9.3-py2.6.egg/zope/app/wsgi/__init__.py",
> line 22, in <module>
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     import
> zope.processlifetime
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/zope.processlifetime-1.0-py2.6.egg/zope/processlifetime/__init__.py",
> line 16, in <module>
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     from zope.interface
> import Attribute
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/zope.interface-3.6.1-py2.6-linux-x86_64.egg/zope/interface/__init__.py",
> line 58, in <module>
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     _wire()
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/zope.interface-3.6.1-py2.6-linux-x86_64.egg/zope/interface/interface.py",
> line 805, in _wire
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]
> classImplements(Attribute, IAttribute)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]   File
> "/srv/grok/merlot/Merlot/eggs/zope.interface-3.6.1-py2.6-linux-x86_64.egg/zope/interface/declarations.py",
> line 447, in classImplements
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x]     spec =
> implementedBy(cls)
> [Tue Jan 25 18:17:35 2011] [error] [client x.x.x.x] TypeError:
> zope.interface.declarations.Implements is not a type
>
> Thanks in advance.
>
> nueces...
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
>
>

Just an idea: would setting the WSGIPythonHome to a virgin virtualenv
as described in [1] work?

1) http://code.google.com/p/modwsgi/wiki/VirtualEnvironments

-- 
Jan-Jaap Driessen


More information about the Grok-dev mailing list