【发布时间】:2016-09-21 17:29:02
【问题描述】:
我想知道如何使用 lighttpd 运行和部署 CKAN。
实际上,我正在使用 mod_proxy 将 lighttpd 重定向到 httpd 替代端口(正在运行 ckan):
$HTTP["host"] == "ckan.example.com"{
proxy.server = ( "" =>
( "" =>
("host" => "127.0.0.1", "port" => 81)
)
)
}
但肯定会降低性能。
apache配置如下:
WSGISocketPrefix /var/run/wsgi
<VirtualHost 0.0.0.0:81>
ServerName localhost
ServerAlias localhost
WSGIScriptAlias / /etc/ckan/default/apache.wsgi
# Pass authorization info on (needed for rest api).
WSGIPassAuthorization On
# Deploy as a daemon (avoids conflicts between CKAN instances).
WSGIDaemonProcess ckan_default display-name=ckan_default processes=2 threads=15
WSGIProcessGroup ckan_default
# Add this to avoid Apache show error:
# "AH01630: client denied by server configuration: /etc/ckan/default/apache.wsgi"
<Directory /etc/ckan/default>
Options All
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/httpd/ckan_default.error.log
CustomLog /var/log/httpd/ckan_default.custom.log combined
</VirtualHost>
/etc/ckan/default/apache.wsgi 是:
import os
activate_this = os.path.join('/usr/lib/ckan/default/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__)), 'development.ini')
from paste.script.util.logging_config import fileConfig
fileConfig(config_filepath)
application = loadapp('config:%s' % config_filepath)
作为 FastCGI 的一种方法是完美的。
【问题讨论】:
标签: python-2.7 wsgi lighttpd ckan