SATU Data: Instalasi CKAN di Ubuntu 16.04

From OnnoWiki
Jump to navigation Jump to search

Instalasi Apps Pendukung

Edit /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-security main universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe multiverse
sudo su
apt update
sudo apt -y install python-dev postgresql libpq-dev \
python-pip python-virtualenv git-core solr-jetty openjdk-8-jdk redis-server


Python virtual environment (virtualenv)

Sebagai user biasa

sudo mkdir -p /usr/lib/ckan/default
sudo chown `whoami` /usr/lib/ckan/default
virtualenv --no-site-packages /usr/lib/ckan/default
. /usr/lib/ckan/default/bin/activate


Install CKAN source code ke dalam virtualenv

pip install setuptools==36.1
pip install -e 'git+https://github.com/ckan/ckan.git@ckan-2.8.3#egg=ckan'
pip install -r /usr/lib/ckan/default/src/ckan/requirements.txt

Deactivate & Reactivate

deactivate
. /usr/lib/ckan/default/bin/activate

Postgresql

Cek instalasi

sudo -u postgres psql -l


Create user ckan_default & masukan password

sudo -u postgres createuser -S -D -R -P ckan_default

Create db

sudo -u postgres createdb -O ckan_default ckan_default -E utf-8

CKAN Config

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 sudo vi /etc/ckan/default/development.ini

sqlalchemy.url

sqlalchemy.url = postgresql://ckan_default:pass@localhost/ckan_default
sqlalchemy.url = postgresql://ckan_default:123456@localhost/ckan_default (contoh)


site_id

ckan.site_id = default

site_url

ckan.site_url = http://demo.ckan.org
ckan.site_url = http://192.168.0.3:5000 (contoh)

Setup Solr

Edit sudo vi /etc/default/jetty8

NO_START=0
JETTY_HOST=127.0.0.1  (contoh)
JETTY_HOST=0.0.0.0    (contoh)
JETTY_PORT=8983


Restart

sudo service jetty8 restart

Replace

sudo mv /etc/solr/conf/schema.xml /etc/solr/conf/schema.xml.bak
sudo ln -s /usr/lib/ckan/default/src/ckan/ckan/config/solr/schema.xml /etc/solr/conf/schema.xml


Restart

sudo service jetty8 restart

Edit sudo vi /etc/ckan/default/development.ini

solr_url=http://127.0.0.1:8983/solr (contoh)
solr_url=http://192.168.0.3:8983/solr (contoh)

Cek

http://192.168.0.3:8983/solr/  (contoh)

Link who.ini

ln -s /usr/lib/ckan/default/src/ckan/who.ini /etc/ckan/default/who.ini

Buat Database

cd /usr/lib/ckan/default/src/ckan
paster db init -c /etc/ckan/default/development.ini

Done

cd /usr/lib/ckan/default/src/ckan
paster serve /etc/ckan/default/development.ini

Lokasi CKAN

http://127.0.0.1:5000/
http://192.168.0.3:5000/

Cek SOLR

http://192.168.0.3:8983/solr/

Referensi

Pranala Menarik