How to set up a CKAN environment using Docker with Solr schema configuration
Setting up CKAN in a Docker environment can sometimes require some additional troubleshooting, particularly when working with Solr for search functionality. In this article, we’ll walk through how to set up CKAN 2.11 in a Docker environment with a specific focus on resolving issues related to Solr schema configuration.
Prerequisites
Before we start, ensure that you have the following installed on your system:
- Docker
- Docker Compose
Understanding and executing common Linux commands for CKAN administration
In this article, we will walk through a series of common Linux commands used for managing CKAN instances on an Ubuntu server with Nginx. We'll cover a variety of actions, explaining each command and its purpose. Whether you’re maintaining a CKAN instance, performing updates, or troubleshooting, this guide will help you understand the underlying operations.
The run through
CKAN templates base verses location of themed
Location of the base templates
cd /usr/lib/ckan/default/src/ckan/ckan/templates
Whereas as the location of the plugin that displays the new template
cd /usr/lib/ckan/default/src/ckanext-{project}/ckanext/{project}/templates
To alter the home main page, edit the
ckan.ini issues
Focusing on the ckan.ini file (/etc/ckan/default/ckan.ini). When I run the commands to recreate the database tables for CKAN:
cd /usr/lib/ckan/default/src/ckan
ckan -c /etc/ckan/default/ckan.ini db init
The response I'm getting is:
server 500 error - 'Internal server error' on Nginx
Finding the issue with a server 500 error
The Nginx error logs are showing too much detail.
Nginx logs and test
There are no errors in the nginx log and sudo nginx -t looks fine
sudo nginx -t
Response
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Setting DataStore with CKAN on Nginx
Following the instructions on CKAN DataStore with a little information.
Enable the plugin
In your CKAN config file (/etc/ckan/default/ckan.ini), update the datastore plugin
ckan.plugins = datastore
Installing CKAN from source on Ubuntu 20.04
If you're planning to create extensions, generating CKAN from source is the preferred option. However, even if you have installed from package, you can make adjustments to creating extensions.
Set up your server
Begin by cleaning up your server environment. Do this by updating Ubuntu’s package index:
How to set up password authentication with Nginx on Ubuntu 20.04
Goal: Restrict content access through username and password entry on an Nginx server.
1: Apache Utilities Package
First, update your server’s package index:
sudo apt update
Check if the utilities package exists in your environment by executing the command
dpkg --get-selections | grep apache
Response:
CKAN extensions
Reviewing CKAN extensions and listing the extensions that have been created / modified in the past three years/
CKAN adding an extension
CKAN extensions - adding to your installation
Following the information on the CKAN site
Use the CKAN create command to create an empty extension:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Then check your location is