[ckan-dev] How to configure CKAN under a non-root path

Steven De Costa steven.decosta at linkdigital.com.au
Fri Jan 29 12:20:33 UTC 2016


Hi Luis, I asks one of our devs to take a look. His response below might
help :)

@Steven , i found the problem, but don't think that there is any elegant
solution.
https://github.com/ckan/ckan/blob/ckan-2.5.1/ckan/lib/helpers.py#L274-L300
- in this code the following happens:
0. 274 - get environment variable - url of ckan instance
1. 277-284 - ignored
2. 287-299 - replace locale in root_path directive
3. 300 - join of ckan_url, prefix from root_path and target url. First two
items in this action are the reason of duplication

so they should either remove directive ckan.root_path because it will
always be used with environment variable or use something like pure
ckan.root_path = /{{LANG}}/

On Friday, January 29, 2016, Luis <eltipicoemail at gmail.com> wrote:

> Hi all,
>
> We have a Drupal installation that lives under a root path so we are
> trying to configure CKAN 2.5.1 under a non-root path ( /datos).
>
> In order to achieve that goal we have the config below:
>
> - In our virtualhost:
>
> ...
>    # CKAN
>    WSGIScriptAlias /datos /etc/ckan/default/apache.wsgi
>    WSGIPassAuthorization On
> ...
>
> - In our production.ini:
>
> ckan.site_url = http://taro-des.fg.ull.es
> ...
> ckan.root_path = /datos/{{LANG}}
>
>
> This is almost working but when links are created subpath is added twice
> so we get:
>
> http://taro-des.fg.ull.es/datos/datos/dataset instead of
> http://taro-des.fg.ull.es/datos/dataset
>
> http://taro-des.fg.ull.es/datos/datos/group instead of
> http://taro-des.fg.ull.es/datos/group
>
> and so on.
>
> We guess the first "datos" is added by Apache and the other one is added
> by CKAN but we don't know how to fix this. Is this the correct way to
> configure this feature?
>
> Any help would be appreciated. Thank you in advance.
>
> Regards,
>


-- 
*STEVEN DE COSTA *|
*EXECUTIVE DIRECTOR*www.linkdigital.com.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160129/1b266ca9/attachment-0003.html>


More information about the ckan-dev mailing list