CKAN Documentation

A working development environment of CKAN has been set up, thourgh it is disconcerting that so many failed attempts has to be worked through first. Below are subsequent attempts to recreate the working setup. They were, however, scuppered by errors encountered in earlier attempts.

 

This is a list of all the actions I undertook to get an instance of CKAN running on Ubuntu 10.04 (On a virtual box machine).

Install Ubuntu 10.04

Close Update Manager (Install no updates)

Open Firefox (Navigate to http://docs.ckan.org/en/ckan-1.7.1/install-from-source.html and http://docs.ckan.org/en/ckan-1.7.1/solr-setup.html#solr-single) For install instructions

Open Terminal

sudo apt-get install mercurial python-dev postgresql libpq-dev

Type password for sudo command

Press Y then return to confirm

sudo apt-get install libxml2-dev libxslt-dev python-virtualenv

Press Y then return to confirm

sudo apt-get install wget build-essential git-core subversion

Press Y then return to confirm

sudo apt-get install solr-jetty openjdk-6-jdk

Press Y then return to confirm

cd ~
virtualenv pyenv
. pyenv/bin/activate
Now line should look like: (pyenv)harry@harry-desktop:~$

Or of equivalent structure

easy_install pip
pip install --ignore-installed -e git+https://github.com/okfn/ckan.git@ckan-1.7#egg=ckan
pip install --ignore-installed -r pyenv/src/ckan/requires/lucid_missing.txt -r pyenv/src/ckan/requires/lucid_conflict.txt
pip install webob==1.0.8
sudo apt-get install python-pybabel python-psycopg2 python-lxml
sudo apt-get install python-pylons python-repoze.who

Y to continue

sudo apt-get install python-repoze.who-plugins python-tempita python-zope.interface

Y to continue

deactivate
. pyenv/bin/activate
sudo -u postgres createuser -S -D -R -P ckanuser
pass
pass

Typing ‘pass’ twice is to set the password for the created user

sudo -u postgres createdb -O ckanuser ckantest
cd pyenv/src/ckan
paster make-config ckan development.ini
sudo nano development.ini

CTRL + X

Setting Up Solr

sudo nano /etc/default/jetty

Change the following lines:

NO_START=1 to NO_START=0

#JETTY_HOST=$(uname -n) to JETTY_HOST=127.0.0.1

#JETTY_PORT=8080 to JETTY_PORT=8983

CTRL + O

<RETURN>

CTRL + X

sudo service jetty start
sudo ln -s /home/harry/pyenv/src/ckan/ckan/config/solr/schema-1.4.xml /etc/solr/conf/schema.xml
sudo /etc/init.d/jetty stop
sudo /etc/init.d/jetty start
sudo nano development.ini
sudo nano ~/pyenv/src/ckan/development.ini

Change the following lines:

# ckan.site_id = ckan.net to ckan.site_id = my_ckan_instance

#solr_url = http://127.0.0.1:8983/solr to solr_url = http://127.0.0.1:8983/solr

CTRL + O

<RETURN>

CTRL + X

cd /home/harry/pyenv/src/ckan

Unauthorized. Password mismatch.

Passwords do not mismatch. It is unknown what is causing this error. Config files show that the passwords are correct and the error has no apparent means of being rectified

CKAN Install Aborted

 

 

 

Install Ubuntu 10.04

Close Update manager (Install no updates)

Open Terminal

Optional: Open Firefox, go to: http://docs.ckan.org/en/ckan-1.7.1/install-from-source.html to follow and copy paste commands from.

sudo apt-get install mercurial python-dev postgresql libpq-dev

Type password for sudo command

Press Y then return to confirm

sudo apt-get install libxml2-dev libxslt-dev python-virtualenv

Press Y then return to confirm

sudo apt-get install wget build-essential git-core subversion

Press Y then return to confirm

sudo apt-get install solr-jetty openjdk-6-jdk

Press Y then return to confirm

cd ~
virtualenv pyenv
. pyenv/bin/activate
Now line should look like: (pyenv)harry@harry-desktop:~$

Or of equivalent structure

easy_install pip
pip install --ignore-installed -e git+https://github.com/okfn/ckan.git@ckan-1.7#egg=ckan
pip install webob==1.0.8
sudo apt-get install python-pybabel python-psycopg2 python-lxml

Type password for sudo command

Press Y then return to confirm

sudo apt-get install python-pylons python-repoze.who

Press Y then return to confirm. Twice

sudo apt-get install python-repoze.who-plugins python-tempita python-zope.interface

Press Y then return to confirm. Twice

deactivate
. pyenv/bin/activate
sudo -u postgres psql -l

‘Encoding’ Column should show UTF-8 for all three records

Press ‘:’ (SHIFT + 😉 then ‘q’ to exit this view and back to the terminal

sudo -u postgres createuser -S -D -R -P ckanuser
pass
pass

‘Pass’ has been written twice as the password for the user we just created, and to confirm it.

sudo -u postgres createdb -O ckanuser ckantest
cd pyenv/src/ckan
paster make-config ckan development.ini
sudo nano development.ini

The line ‘sqlalchemy.url = postgresql://ckanuser:pass@localhost/ckantest’ shouild read as written. if not, change it to read as written.

There are two lines commented out under this line (By the #) also called ‘sqlalchemy.url’. Ignore these. Do not change them. The lines should now read as follows:

sqlalchemy.url = postgresql://ckanuser:pass@localhost/ckantest
#sqlalchemy.url = sqlite:///
#sqlalchemy.url = sqlite:///%(here)s/somedfb.db

CTRL + O

<RETURN>

CTRL + X

This saves the file and closes it, returning to the terminal screen.

 

Set up Solr

 

sudo apt-get install solr-jetty openjdk-6-jdk

This should attempt to install solr-jetty, but as it is already installed earlier on it will fail. This is just to ensure that it is installed properly.

sudo nano /etc/default/jetty

Change the following lines:

NO_START=1 to NO_START=0

#JETTY_HOST=$(uname -n) to JETTY_HOST=127.0.0.1

#JETTY_PORT=8080 to JETTY_PORT=8983

CTRL + O

<RETURN>

CTRL + X

sudo service jetty start

Open Firefox, go to http://127.0.0.1:8983

You should see the ‘Welcome to Jetty 6 on Debian’ page

Go to http://127.0.0.1:8983/solr

You should see the ‘Welcome to Solr’ page

Click on the ‘admin’ link (Or go to http://127.0.0.1:8983/solr/admin)

You should see ‘Solr Admin (Example)’.

Go back to the terminal

sudo service jetty stop
sudo service jetty start
sudo mv /etc/solr/conf/schema.xml /etc/solr/conf/schema.xml.bak
sudo ln -s ~/pyenv/src/ckan/ckan/config/solr/schema-1.4.xml /etc/solr/conf/schema.xml
cd ~
sudo service jetty stop
sudo service jetty start
sudo /etc/init.d/jetty stop
sudo /etc/init.d/jetty start

Go to http://127.0.0.1:8982/solr/admin

You should see ‘Solr Admin (ckan)’

sudo nano ~/pyenv/src/ckan/development.ini

Change the following lines:

# ckan.site_id = ckan.net to ckan.site_id = my_ckan_instance

#solr_url = http://127.0.0.1:8983/solr to solr_url = http://127.0.0.1:8983/solr

CTRL + O

<RETURN>

CTRL + X

cd /pyenv/src/ckan

Missing Genshi module

This error has been encountered before, and the module in question was installed along with each subsequent module missing. This got nowhere and eved with an error stating that a function was expecting one argument but was receiving two.

CKAN INSTALL ABORTED

Leave a Reply

Your email address will not be published. Required fields are marked *