Wiki

Clone wiki

kobo-install / kobo

dkobo

Follow the https://github.com/kobotoolbox/dkobo

diff --git a/.bowerrc b/.bowerrc
-    "grunt-sass": "~0.12.1",
+    "grunt-sass": "~0.13.0",

Environment: workon pykobo

Install requirements:

pip install -r requirements.txt
npm install
bower install

Migrate database

python manage.py syncdb
python manage.py migrate

Access Postgres db:

sudo -u postgres psql postgres

Important: Follow instruction to define Django superuser!

User: dkobo Password: dkobo

Start server

python manage.py  gruntserver 193.134.241.169:8000

redis

Install redis from redis.io

Create redis user:

sudo useradd -rMU -d /var/lib/redis -s /bin/false -c redis-server redis

Create dirs

sudo mkdir /etc/redis
sudo mkdir /var/lib/redis
sudo mkdir /var/log/redis

Change owner of log

sudo chown redis:redis /var/log/redis

  • data dir: /var/lib/redis/

Install Redis on Ubuntu

enketo

Follow: http://blog.enketo.org/install-enketo-production-ubuntu/

Install from https://github.com/kobotoolbox/enketo-express

  • conf dir: /etc/redis Files: setup/redis/conf/redis-enketo-main.conf & setup/redis/conf/redis-enketo-cache.conf

Comment /etc/redis/conf.d/local.conf

  • init dir: /etc/init Files: setup/redis/init/redis-server-enketo-main.conf & setup/redis/init/redis-server-enketo-cache.conf

Change binary in setup/redis/init to /usr/local/bin/redis-server

-include /etc/redis/conf.d/local.conf
+#include /etc/redis/conf.d/local.conf

Test redis:

quinto@SWIGEEUD001:~$ grep -n port  /etc/redis/redis-enketo-*
/etc/redis/redis-enketo-cache.conf:7:port 6380
/etc/redis/redis-enketo-main.conf:7:port 6379

  • Test main database

    (pykobo)quinto@SWIGEEUD001:~/src/kobo$ redis-cli -p 6379
    127.0.0.1:6379> ping
    PONG
    127.0.0.1:6379> exit
    

  • Test cache database

    (pykobo)quinto@SWIGEEUD001:~/src/kobo/enketo-express$ redis-cli -p 6380
    127.0.0.1:6380> ping
    PONG
    127.0.0.1:6380> exit
    

Misc

Install sqllite tools

sudo apt-get install sqlite

Important: install coffee-script

npm install -g coffee-script
@TODO check documentation

Apache configuration

As the service is running on python (port configured ./dkobo/scripts/start_dev* it should use proxy configuration

  ProxyRequests Off
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

  ProxyPreserveHost On
  ProxyPass / http://127.0.0.1:8000/
  ProxyPassReverse / http://127.0.0.1:8000/

dkobo Email configuration

Important: the registration process sends out a confirmation email and the link must be configured with the appropriate site name (site.domain).

Solution (NO!!): set Site Name in /admin/sites/site/ Solution (NO!!!): set KOBOCAT_URL in ./dkobo/settings.py.

@TODO check if is enough

SMTP configuration stored in ./dkobo/settings.py

EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
EMAIL_PORT = 587
EMAIL_USE_TLS = True

Updated