[ckan-dev] Running one CKAN on two different vhosts

Stefan Oderbolz stefan.oderbolz at liip.ch
Tue Sep 26 08:05:39 UTC 2017


Hi,

we had a similar requirement but with only one instance, we introduced a
new config option called "ckan.internal_site_url" and changed some parts of
datapusher to use this new config value.


But back to your question: the current implementation of CKAN clearly sets
the url value based on the config values at upload time. If you want to
change it, I'd recomment to use the IResourceController interface with the
before_view method (
http://docs.ckan.org/en/ckan-2.7.0/extensions/plugin-interfaces.html#ckan.plugins.interfaces.IResourceController.before_show).
There you should be able to change the value from the database to the value
you want (using something like urlparse or simply replace the old with the
new domain name).

Hope this helps.

- Stefan

On Sun, Sep 24, 2017 at 11:58 PM, CKAN Austria <ckanaustria at gmail.com>
wrote:

> Hi,
>
> I have a rather unusual requirement to host a CKAN which should be
> available thru two different virtual hosts in Apache with one CKAN instance
> "mounted" with separate configuration files.
>
> VHost 1 - Publicly available https://ckansite.com (site_url: ckansite.com
> root_path: /)
>
> VHost 2 - Internally available https://data.site.com/ckan/ (site_url:
> data.site.com, root_path: /ckan/{{LANG}})
>
> Virtual Host 2 should be used to access the administrative part of CKAN
> and to manage the datasets. Virtual host 1 should be only used to retrieve
> the public data-sets. Additionally there are some other sites that access
> VHost 2 in reverse proxy manner.
>
> CKAN uses DataPusher component.
>
> As far as I understand CKAN - the URL of a dataset is generated upon
> upload and it depends on the site_url and the root_path. So if I upload a
> dataset on Vhost 2, the Vhost 1 will show the "original" URL of the
> data-set that might not be reached publicly. If I change the domain and
> root_path manually, I am able to retrieve the data-set.
>
> Could the URL of a data-set always be based on the actual values of the
> site_url and root_path?
> Is there a way to achieve this? Basically I want to be independent of the
> CKAN "instance" that is reached and be able to retrieve the data-sets.
>
> Thank you in advance!
>
> Best regards,
> E
>
>
>
> _______________________________________________
> 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
>
>


-- 
Liip AG  // Limmatstrasse 183 //  CH-8005 Zürich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20170926/5b660521/attachment-0003.html>


More information about the ckan-dev mailing list