-
Notifications
You must be signed in to change notification settings - Fork 0
How to setup CKAN on Dev server
- Ubuntu 18.04
- Python 2.7
screen -S ckan
sudo su ubuntu
sudo apt-get update
-
sudo apt-get install python-dev postgresql libpq-dev python-pip python-virtualenv git-core openjdk-8-jdk redis-server
-
Install CKAN into a Python virtual environment
mkdir -p ~/ckan/lib sudo ln -s ~/ckan/lib /usr/lib/ckan mkdir -p ~/ckan/etc sudo ln -s ~/ckan/etc /etc/ckan sudo mkdir -p /usr/lib/ckan/ckan-env sudo chown `whoami` /usr/lib/ckan/ckan-env virtualenv --no-site-packages /usr/lib/ckan/ckan-env . /usr/lib/ckan/ckan-env/bin/activate pip install setuptools==36.1 pip install -e 'git+https://github.com/ckan/[email protected]#egg=ckan' pip install -r /usr/lib/ckan/ckan-env/src/ckan/requirements.txt deactivate . /usr/lib/ckan/ckan-env/bin/activate
-
sudo -u postgres createuser -S -D -R -P <db_owner_name> sudo -u postgres createdb -O <db_owner_name> db_name> -E utf-8
-
sudo mkdir -p /etc/ckan/default sudo chown -R `whoami` /etc/ckan/ sudo chown -R `whoami` ~/ckan/etc paster make-config ckan /etc/ckan/default/development.ini
-
Edit the development.ini file in a text editor, changing the following options:
sqlalchemy.url = postgresql://<db_owner_name>:<owner_password>@localhost/<db_name> ckan.site_id = default ckan.site_url = http://<server_ip | domain_name>:5000
-
-
Setup Solr
-
Docs: https://github.com/ckan/ckan/wiki/Install-and-use-Solr-6.5-with-CKAN
-
Download the source and extract:
wget https://archive.apache.org/dist/lucene/solr/8.3.1/solr-8.3.1.zip unzip solr-8.3.1.zip
-
Install using the shell script
cd solr-8.3.1/bin/ sudo ./install_solr_service.sh ../../solr-8.3.1.zip
-
Create the
ckan
coresudo su solr cd /opt/solr/bin ./solr create -c ckan
-
Proceed to edit the configuration files.
cd /var/solr/data/ckan/conf
-
Open solrconfig.xml and insert following line into the root
<config>
element:<schemaFactory class="ClassicIndexSchemaFactory"/>
-
Comment the element
add-schema-fields
from<updateRequestProcessorChain
'sprocessor
attribute. -
Next, remove the
managed-schema
file -
Edit the
/usr/lib/ckan/ckan-env/src/ckan/ckan/config/solr/schema.xml
file-
Comment the lines containing
defaultSearchField
andsolrQueryParser
. -
Change the following as below:
textgen > text_general tdate > pdate tdates > pdates tlong > plong tlongs > plongs tdouble > pdouble tdoubles > pdoubles
-
-
and copy the schema.xml to solr:
cp /usr/lib/ckan/ckan-env/src/ckan/ckan/config/solr/schema.xml schema.xml
-
Restart solr:
sudo service solr restart
-
Finally, change the solr_url setting in your CKAN configuration file
(/etc/ckan/default/development.ini)
to point to your Solr server, for example:solr_url=http://<server_ip>:8983/solr/ckan
-
-
ln -s /usr/lib/ckan/ckan-env/src/ckan/who.ini /etc/ckan/default/who.ini
-
cd /usr/lib/ckan/ckan-env/src/ckan paster db init -c /etc/ckan/default/development.ini
-
paster sysadmin add <admin_username> email=<admin_email> name=<admin_name> -c /etc/ckan/default/development.ini
-
cd /usr/lib/ckan/ckan-env/src/ckan paster serve /etc/ckan/default/development.ini
-
-
Create the directory for uploads
sudo mkdir -p /var/lib/ckan/justice-hub-uploads
-
Add the following line to your CKAN config file (
/etc/ckan/default/production.ini
), after the[app:main]
line:ckan.storage_path = /var/lib/ckan/justice-hub-uploads
-
Set the permission of your
storage_path
directory. For example if you’re running CKAN with Apache, then Apache’s user (www-data
on Ubuntu) must have read, write and execute permissions for thestorage_path
sudo chown www-data:www-data /var/lib/ckan/justice-hub-uploads sudo chmod u+rwx /var/lib/ckan/justice-hub-uploads
-
-
-
Enable the plugin
ckan.plugins = datastore
-
setup the database
sudo -u postgres createuser -S -D -R -P -l <datastore_owner_name> sudo -u postgres createdb -O <db_owner_name> <datastore_db_name> -E utf-8
-
set URLs
ckan.datastore.write_url = postgresql://<db_owner_name>:<db_owner_password>@localhost/<datastore_db_name> ckan.datastore.read_url = postgresql://<datastore_owner_name>:<datastore_owner_password>@localhost/<datastore_db_name>
-
set permissions
paster --plugin=ckan datastore set-permissions -c /etc/ckan/default/development.ini | sudo -u postgres psql --set ON_ERROR_STOP=1 NOTE: We have not yet set DataPusher
-
- Install CKAN from source
- Install and use Solr 6.5 with CKAN
- CKAN Datastore Extension
- CKAN: Creating a sysadmin user
- solr on ubuntu 18.04 with ckan 2.8.2
- Source install docs for Ubuntu 18.04 don't work with solr-jetty
- Is it possible to install ckan on ubuntu 18.04?
- How do I change the number of open files limit in Linux?
- How do I increase the open files limit for a non-root user?
- Solr Error This Indexschema is not mutable