Ajude a Asast
Patrocinadores
Últimos assuntos
» Novo site para desportistas / New site for athletes
Sex Mar 17, 2017 8:31 am por Admin

» List files by date
Sex Mar 17, 2017 8:24 am por Admin

» RegExp - Add XXX to the begin of a String
Sex Nov 18, 2016 1:44 am por Admin

» RegExp - Add XXX to the end of a String
Sex Nov 18, 2016 1:38 am por Admin

» Great book about DOD programming
Sex Nov 11, 2016 6:59 am por Admin

» MESOS (Apache)
Qui Set 29, 2016 1:51 am por Admin

» Site de aluguer entre particulares
Sex Jul 01, 2016 3:01 am por Admin

» Noite das maravilhas - Nuit des merveilles
Sex Jul 01, 2016 2:54 am por Admin

» Site para procura de emprego no Luxemburgo
Qui Jun 30, 2016 7:13 am por Admin

AdSense
Contributo

CKAN installation in a Ubuntu 12.04.4 Virtual Machine (under VMWare)

Ver o tópico anterior Ver o tópico seguinte Ir em baixo

CKAN installation in a Ubuntu 12.04.4 Virtual Machine (under VMWare)

Mensagem  Admin em Ter Mar 25, 2014 9:35 am

Here are the steps to execute to install CKAN on a Ubuntu server (v. 12.04.4) running into a virtual machine (VMWare):

Código:


User: username
Password: password

1 - sudo apt-get install console-data
(to have the correct keyboard definition)

2 - sudo apt-get install python-dev postgresql libpq-dev python-pip python-virtualenv git-core solr-jetty openjdk-6-jdk

4 - sudo mkdir -p ~/ckan/lib

5 - sudo ln -s ~/ckan/lib /usr/lib/ckan

6 - sudo mkdir -p ~/ckan/etc

7 - sudo ln -s ~/ckan/etc /etc/ckan

Create a Python virtual environment (virtualenv) to install CKAN into, and activate it:

8 - sudo mkdir -p /usr/lib/ckan/default

9 - sudo chown 'username' /usr/lib/ckan/default

10 - virtualenv --no-site-packages /usr/lib/ckan/default

11 - . /usr/lib/ckan/default/bin/activate

12 - pip install -e 'git+https://github.com/ckan/ckan.git@ckan-2.2#egg=ckan'

13 - ls -la /usr/lib/ckan/default/src/ckan/

14 - pip install -r /usr/lib/ckan/default/src/ckan/requirements.txt

15 - deactivate

16 - . /usr/lib/ckan/default/bin/activate

Setup a PostgreSQL database

17 - sudo -u postgres psql -l
=> Check that the encoding of databases is UTF8, if not internationalisation may be a problem. Since changing the encoding of PostgreSQL may mean deleting existing databases, it is suggested that this is fixed before continuing with the CKAN install.

Create User
18 - sudo -u postgres createuser -S -D -R -P ckan_default
password: ckan_default

Create database
19 - sudo -u postgres createdb -O ckan_default ckan_default -E utf-8

Create a CKAN config file
20 - sudo mkdir -p /etc/ckan/default

21 - sudo chown -R 'username' /etc/ckan/

22 - cd /usr/lib/ckan/default/src/ckan/

23 - paster make-config ckan /etc/ckan/default/development.ini

24 - Edit the development.ini file in a text editor, changing the following options:
sqlalchemy.url = postgresql://ckan_default:pass@localhost/ckan_default
solr_url = http://127.0.0.1:8080/solr

Setup Solr (on a Jetty webserver - can be made on other webservers like tomcat...)
25 - Edit the Jetty configuration file (sudo vi /etc/default/jetty) and change the following variables:
NO_START=0            
JETTY_HOST=0.0.0.0
JETTY_PORT=8080    
JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64/

26 - sudo service jetty start

27 - sudo mv /etc/solr/conf/schema.xml /etc/solr/conf/schema.xml.bak

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

29 - sudo service jetty restart


Create database tables

30 - cd /usr/lib/ckan/default/src/ckan

31 - paster db init -c /etc/ckan/default/development.ini

32 - sudo service jetty stop

Set up the DataStore
33 - vi /etc/ckan/default/development.ini
add "datastore" on the ckan.plugins options

34 - service jetty stop

35 - sudo -u postgres createuser -S -D -R -P -l datastore_default

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

37 - sudo vi /etc/ckan/default/development.ini
=> ckan.datastore.write_url = postgresql://ckan_default:pass@localhost/datastore_default
=> ckan.datastore.read_url = postgresql://datastore_default:pass@localhost/datastore_default

38 - service jetty start

SETTING THE PERMISSIONS (CAREFUL: FOR REMOTE DATABASE IT IS A DIFFERENT WAY. THIS WAY IS FOR A DATABASE
39 - paster datastore set-permissions postgres -c /etc/ckan/default/development.ini
=> Set permissions for read-only user: SUCCESS

40 - sudo apt-get install curl

41 - sudo service jetty stop

42 - sudo service jetty start

43 - Test the installation
=> curl -X GET "http://127.0.0.1:5000/api/3/action/datastore_search?resource_id=_table_metadata"
=> curl -X POST http://127.0.0.1:5000/api/3/action/datastore_create -H "Authorization: {YOUR-API-KEY}" -d '{"resource_id": "{RESOURCE-ID}", "fields": [ {"id": "a"}, {"id": "b"} ], "records": [ { "a": 1, "b": "xyz"}, {"a": 2, "b": "zzz"} ]}'

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

45 - cd /usr/lib/ckan/default/src/ckan

46 - paster serve /etc/ckan/default/development.ini

avatar
Admin
Admin

Mensagens : 596
Data de inscrição : 21/01/2008
Idade : 39

Ver perfil do usuário http://forum-informatico.forumeiros.com

Voltar ao Topo Ir em baixo

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo

- Tópicos similares

 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum