2017-05-03 1 views
0

ckan 2.7のdatapusherを設定しようとしています。前提条件としてdatastoreとapache http serverをインストールしました。CKAN配布が見つかりませんでした。CKANをApacheから提供しようとしました。

のApacheのhttpdバージョン:Apacheの/ 2.4.25(Unixの) のmod_wsgiパッケージはckan_default.confhttp://docs.ckan.org/en/latest/maintaining/installing/deployment.html

内容はCKANドキュメントに指定されているのconfファイル用4.5.15 権限があるインストール

:apache.wsgiファイルの

WSGIScriptAlias//etc/ckan/default/apache.wsgi 

WSGIPassAuthorization On 

WSGIDaemonProcess ckan_default display-name=ckan_default processes=2 threads=15 

WSGIProcessGroup ckan_default 

ErrorLog /var/log/apache2/ckan_default.error.log 

CustomLog /var/log/apache2/ckan_default.custom.log combined 

内容です

import os 
ckan_home = os.environ.get('CKAN_HOME', '/usr/lib/ckan/default') 

activate_this = os.path.join(ckan_home, 'bin/activate_this.py') 

execfile(activate_this, dict(__file__=activate_this)) 

from paste.deploy import loadapp 

config_filepath = os.path.join(os.path.dirname(os.path.abspath(__file__)), 
'production.ini') 

from paste.script.util.logging_config import fileConfig 

fileConfig(config_filepath) 

application = loadapp('config:%s' % config_filepath) 

私がApacheのhttpdサーバーを起動すると、次のログが表示されます。ログのエラー

[Tue May 02 17:39:23.953718 2017] [wsgi:error] [pid 24744:tid 140135528146688] mod_wsgi (pid=24744): Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as Python module. 

[Tue May 02 17:39:23.953836 2017] [wsgi:error] [pid 24744:tid 140135528146688] mod_wsgi (pid=24744): Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'. 

[Tue May 02 17:39:23.953875 2017] [wsgi:error] [pid 24744:tid 140135528146688] Traceback (most recent call last): 

[Tue May 02 17:39:23.953912 2017] [wsgi:error] [pid 24744:tid 140135528146688] File "/etc/ckan/default/apache.wsgi", line 10, in <module> 
[Tue May 02 17:39:23.954043 2017] [wsgi:error] [pid 24744:tid 140135528146688] application = loadapp('config:%s' % config_filepath) 

[Tue May 02 17:39:23.954067 2017] [wsgi:error] [pid 24744:tid 140135528146688] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp 

[Tue May 02 17:39:23.955927 2017] [wsgi:error] [pid 24744:tid 140135528146688] DistributionNotFound: The 'ckan' distribution was not found and is required by the application 

誰でもこの問題を解決できますか?事前に おかげ

PS:CKANサイトの負荷ペースターは

+0

好ましいメカニズムを使用してみてくださいmod_wsgiを使ってPython仮想環境を設定します。 http://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.htmlを参照してください。 –

答えて

1

仕える用いて微細なグラハムDumpleton.Theリンクが助けていただきありがとうございます。 問題は、インストールされているpythonsと仮想環境パスのバージョンが異なるためです。 適切な仮想環境のパスを追加して設定しました。

ステップ1)は、仮想環境をアクティブ

ステップ2)仮想前(仮想ENV

python -c 'import sys; print(sys.prefix)' 

ステップ3)ckan_default.confファイル内の以下の行を追加の経路を知っているコマンドの下に実行ホスト)

WSGIPythonHome <path you got in step 2> 

ステップ4)Apacheを再起動

関連する問題