我正在尝试从Source安装CKAN,并已按照此处的说明通过设置Apache来进行生产部署: https://docs.ckan.org/en/2.8/maintaining/installing/install-from-source.html https://docs.ckan.org/en/2.8/maintaining/installing/deployment.html
在安装结束时情况很好,并且粘贴程序可以在5000端口上为CKAN提供服务。
然后通过部署工作,一切似乎一直进行到最后返回403错误为止。日志详细说明了符号链接不起作用。因此(这是我最有可能弄糟的地方),我取消了符号链接并使它们全部成为硬链接。这解决了符号链接问题,并在日志中出现此错误:
[Sat Oct 06 04:49:57.350067 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] mod_wsgi (pid=9767): Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as Python module.
[Sat Oct 06 04:49:57.350117 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] mod_wsgi (pid=9767): Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'.
[Sat Oct 06 04:49:57.350138 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] Traceback (most recent call last):
[Sat Oct 06 04:49:57.350154 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/etc/ckan/default/apache.wsgi", line 9, in <module>
[Sat Oct 06 04:49:57.350200 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] application = loadapp('config:%s' % config_filepath)
[Sat Oct 06 04:49:57.350210 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
[Sat Oct 06 04:49:57.350354 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] return loadobj(APP, uri, name=name, **kw)
[Sat Oct 06 04:49:57.350363 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 271, in loadobj
[Sat Oct 06 04:49:57.350378 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] global_conf=global_conf)
[Sat Oct 06 04:49:57.350384 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
[Sat Oct 06 04:49:57.350392 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] global_conf=global_conf)
[Sat Oct 06 04:49:57.350398 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 320, in _loadconfig
[Sat Oct 06 04:49:57.350407 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] return loader.get_context(object_type, name, global_conf)
[Sat Oct 06 04:49:57.350412 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 454, in get_context
[Sat Oct 06 04:49:57.350421 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] section)
[Sat Oct 06 04:49:57.350426 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 476, in _context_from_use
[Sat Oct 06 04:49:57.350435 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] object_type, name=use, global_conf=global_conf)
[Sat Oct 06 04:49:57.350440 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 406, in get_context
[Sat Oct 06 04:49:57.350448 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] global_conf=global_conf)
[Sat Oct 06 04:49:57.350453 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
[Sat Oct 06 04:49:57.350473 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] global_conf=global_conf)
[Sat Oct 06 04:49:57.350479 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 328, in _loadegg
[Sat Oct 06 04:49:57.350487 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] return loader.get_context(object_type, name, global_conf)
[Sat Oct 06 04:49:57.350492 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 620, in get_context
[Sat Oct 06 04:49:57.350500 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] object_type, name=name)
[Sat Oct 06 04:49:57.350505 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 640, in find_egg_entry_point
[Sat Oct 06 04:49:57.350513 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] pkg_resources.require(self.spec)
[Sat Oct 06 04:49:57.350518 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/pkg_resources/__init__.py", line 971, in require
[Sat Oct 06 04:49:57.350982 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] needed = self.resolve(parse_requirements(requirements))
[Sat Oct 06 04:49:57.350992 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] File "/usr/lib/ckan/default/lib/python2.7/site-packages/pkg_resources/__init__.py", line 857, in resolve
[Sat Oct 06 04:49:57.351005 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] raise DistributionNotFound(req, requirers)
[Sat Oct 06 04:49:57.351045 2018] [wsgi:error] [pid 9767:tid 140487660848896] [remote 206.189.25.243:40141] DistributionNotFound: The 'ckan' distribution was not found and is required by the application
我已经遍历了在堆栈溢出和其他地方找到的各种解决方案,这些解决方案实际上等于找到具有错误权限的文件夹或文件。我也尝试过在这里找到WSGIPythonHome修复程序: CKAN distribution not found error while trying to serve CKAN from apache
现在我不能再使用粘贴程序,错误再次出现:
-bash: /usr/lib/ckan/default/bin/paster: Permission denied
这是我在全新安装Ubuntu之前的最后一次尝试,然后再次从头开始。任何意见,将不胜感激。甚至还有一些建议,可以解决此类问题。