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

Luis eltipicoemail at gmail.com
Fri Feb 5 13:55:39 UTC 2016


Hi Steven,

Sorry for the late response. Thanks very much for your help and efforts
from your team.
We have reached the same conclusion and we have "hacked" the
_add_i18n_to_url function in helpers.py (we also wonder if there is any
more elegant solution but we guess there is not).

Kind regards,
Luis

2016-01-29 12:20 GMT+00:00 Steven De Costa <
steven.decosta at linkdigital.com.au>:

> 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
>
>
>
>
> _______________________________________________
> 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/20160205/377bd944/attachment-0002.html>


More information about the ckan-dev mailing list