[ckan-dev] Archiver archive_dir and cache_url_root: SOLVED
McDonaldR
McDonaldR at angus.gov.uk
Thu Aug 11 09:27:29 UTC 2016
After much trial and error I sorted out the configuration in nginx config file and production.ini so I'm posting here for the record.
Nginx - change it from this:
# Archived Files
location /resource_cache {
root /usr/share/nginx/html/resource_cache;
}
To this:
# Archived Files
location /resource_cache {
root /usr/share/nginx/html;
}
Production.ini - change it from this:
* ckanext-archiver.archive_dir = /usr/share/nginx/html/resource_cache
* ckanext-archiver.cache_root_url = http://opendata.angus.gov.uk/resource_cache
To this:
* ckanext-archiver.archive_dir = /usr/share/nginx/html/resource_cache
* ckanext-archiver.cache_root_url = http://opendata.angus.gov.uk/resource_cache/
The download cached content link now works on the resource page
Simple changes!
From: ckan-dev [mailto:ckan-dev-bounces at lists.okfn.org] On Behalf Of McDonaldR
Sent: 10 August 2016 15:09
To: ckan-dev at lists.okfn.org
Subject: [ckan-dev] Archiver archive_dir and cache_url_root
Hi List,
I've create the following directory (owned by www-data) for the archiver plugin:
/usr/share/nginx/html/resource_cache
This has sub-directories like
* 26/someresourceid/kml
* 2f/someotherresourceid/ows
* etc
I have set the following in my production.ini
* ckanext-archiver.archive_dir = /usr/share/nginx/html/resource_cache
* ckanext-archiver.cache_root_url = http://opendata.angus.gov.uk/resource_cache
My nginx config file looks like this:
# Archived Files
location /resource_cache {
root /usr/share/nginx/html/resource_cache;
}
The download URL presented in the archive section of the resources page looks like this:
http://opendata.angus.gov.uk/98/987c7253-0da3-4dba-8bb1-f871a2de31ee/kml but I get a 404 not found from CKAN
If I amend the URL to include "resource_cache"
http://opendata.angus.gov.uk/resource_cache/98/987c7253-0da3-4dba-8bb1-f871a2de31ee/kml I also get a 404 not found but from Nginx
Archiver is working correctly as the cache resources are created in the defined directory and qa.update_package sniffs out the correct file format in the correct directory but the link presented by the frontend resource template is not correct. Any suggestions gratefully received.
Thanks
Ross
Ross McDonald | GIS Data Coordinator | Resources Department, IT Division | Angus Council, Angus House, Orchardbank Business Park, Forfar, DD8 1AT
T: 01307 476419 | F: 01307 476401 | E: mcdonaldr at angus.gov.uk<mailto:mcdonaldr at angus.gov.uk>
This message is strictly confidential. If you have received this in error, please inform the sender and remove it from your system. If received in error you may not copy, print, forward or use it or any attachment in any way. This message is not capable of creating a legal contract or a binding representation and does not represent the views of Angus Council. Emails may be monitored for security and network management reasons. Messages containing inappropriate content may be intercepted. Angus Council does not accept any liability for any harm that may be caused to the recipient system or data on it by this message or any attachment.
This message is strictly confidential. If you have received this in error, please inform the sender and remove it from your system. If received in error you may not copy, print, forward or use it or any attachment in any way. This message is not capable of creating a legal contract or a binding representation and does not represent the views of Angus Council. Emails may be monitored for security and network management reasons. Messages containing inappropriate content may be intercepted. Angus Council does not accept any liability for any harm that may be caused to the recipient system or data on it by this message or any attachment.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160811/d2573084/attachment-0002.html>
More information about the ckan-dev
mailing list