[ckan-dev] Issue running CKAN 2.2 in RHEL 6.5 with SELinux in Enforcing mode

Ross Thompson ross.thompson.ca at gmail.com
Fri Aug 1 14:08:32 UTC 2014


When I set up CKAN on a CentOS 6 image I had to set some SELinux policies
for HTTPD before it would run:

setsebool –P httpd_can_network_connect on
setsebool –P httpd_can_network_connect_db on
setsebool –P httpd_execmem on

as well as set the file context:

restorecon –vR /var/www/html/myckanfolder

So if you're running CKAN under Apache, this could be the issue.





On 31 July 2014 12:40, Joe Tsoi <joe.tsoi at okfn.org> wrote:

> been a while since I've dealt with selinux problems, you might want to
> run a sealert -b to browse through the to find the log for the error
> and post it back to the list.
>
> On 31 July 2014 15:44, Paolo Starace <paolo at sciamlab.com> wrote:
> > Hello
> >
> > I'm installing CKAN 2.2 in RHEL 6.5 trying to keep SELinux Enforcing.
> >
> > Following the instructions I found at
> > https://github.com/ckan/ckan/wiki/How-to-Install-CKAN-2.0-on-CentOS-6.3
> I
> > did:
> > semanage fcontext --add --ftype -- --type httpd_sys_content_t
> > "/usr/local/[DNS](/.*)?"
> > semanage fcontext --add --ftype -d --type httpd_sys_content_t
> > "/usr/local/[DNS](/.*)?"
> > restorecon -vR /usr/local/[DNS]
> >
> > and
> > setsebool -P httpd_can_network_connect 1
> >
> > I've deployed it via httpd on port 80 and it runs fine until the SELinux
> is
> > in Permissive mode.
> >
> > If I change it to Enforced, once restarted the httpd service, visiting
> the
> > ckan home page I get:
> >
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100] mod_wsgi
> > (pid=27724): Target WSGI script '/etc/ckan/laitdev/etc/laitdev.wsgi'
> cannot
> > be loaded as Python module.
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100] mod_wsgi
> > (pid=27724): Exception occurred processing WSGI script
> > '/etc/ckan/laitdev/etc/laitdev.wsgi'.
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100] Traceback (most
> > recent call last):
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> > "/etc/ckan/laitdev/etc/laitdev.wsgi", line 9, in <module>
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]
> application =
> > loadapp('config:%s' % config_filepath)
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> >
> "/usr/lib/ckan/laitdev/lib/python2.6/site-packages/paste/deploy/loadwsgi.py",
> > line 247, in loadapp
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     return
> > loadobj(APP, uri, name=name, **kw)
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> >
> "/usr/lib/ckan/laitdev/lib/python2.6/site-packages/paste/deploy/loadwsgi.py",
> > line 272, in loadobj
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     return
> > context.create()
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> >
> "/usr/lib/ckan/laitdev/lib/python2.6/site-packages/paste/deploy/loadwsgi.py",
> > line 710, in create
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     return
> > self.object_type.invoke(self)
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> >
> "/usr/lib/ckan/laitdev/lib/python2.6/site-packages/paste/deploy/loadwsgi.py",
> > line 146, in invoke
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     return
> > fix_call(context.object, context.global_conf, **context.local_conf)
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> > "/usr/lib/ckan/laitdev/lib/python2.6/site-packages/paste/deploy/util.py",
> > line 56, in fix_call
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     val =
> > callable(*args, **kw)
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> > "/home/ckan/ckan/lib/laitdev/src/ckan/ckan/config/middleware.py", line
> 57,
> > in make_app
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]
> > load_environment(conf, app_conf)
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> > "/home/ckan/ckan/lib/laitdev/src/ckan/ckan/config/environment.py", line
> 232,
> > in load_environment
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]
> > p.load_all(config)
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> > "/home/ckan/ckan/lib/laitdev/src/ckan/ckan/plugins/core.py", line 134, in
> > load_all
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]
> load(*plugins)
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> > "/home/ckan/ckan/lib/laitdev/src/ckan/ckan/plugins/core.py", line 149, in
> > load
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     service =
> > _get_service(plugin)
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> > "/home/ckan/ckan/lib/laitdev/src/ckan/ckan/plugins/core.py", line 255, in
> > _get_service
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     return
> > plugin.load()(name=plugin_name)
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> >
> "/usr/lib/ckan/laitdev/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py",
> > line 1954, in load
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     entry =
> > __import__(self.module_name, globals(),globals(), ['__name__'])
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> >
> "/home/ckan/ckan/lib/laitdev/src/ckanext-spatial/ckanext/spatial/plugin.py",
> > line 15, in <module>
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     from
> > ckanext.spatial.lib import save_package_extent,validate_bbox, bbox_query,
> > bbox_query_ordered
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> >
> "/home/ckan/ckan/lib/laitdev/src/ckanext-spatial/ckanext/spatial/lib/__init__.py",
> > line 8, in <module>
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     from
> > shapely.geometry import asShape
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> >
> "/usr/lib/ckan/laitdev/lib/python2.6/site-packages/shapely/geometry/__init__.py",
> > line 4, in <module>
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     from .base
> > import CAP_STYLE, JOIN_STYLE
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> >
> "/usr/lib/ckan/laitdev/lib/python2.6/site-packages/shapely/geometry/base.py",
> > line 9, in <module>
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     from
> > shapely.coords import CoordinateSequence
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> > "/usr/lib/ckan/laitdev/lib/python2.6/site-packages/shapely/coords.py",
> line
> > 8, in <module>
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     from
> > shapely.geos import lgeos
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]   File
> > "/usr/lib/ckan/laitdev/lib/python2.6/site-packages/shapely/geos.py", line
> > 194, in <module>
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100]     error_h =
> > EXCEPTION_HANDLER_FUNCTYPE(error_handler)
> > [Wed Jul 30 17:51:23 2014] [error] [client 192.168.0.100] MemoryError
> >
> > Do you have any clue on how to solve?
> >
> > Thanks
> > Paolo
> >
> > _______________________________________________
> > ckan-dev mailing list
> > ckan-dev at lists.okfn.org
> > https://lists.okfn.org/mailman/listinfo/ckan-dev
> > Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> >
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140801/fbfed277/attachment-0002.html>


More information about the ckan-dev mailing list