Project

General

Profile

Actions

Installation

Additional steps after clean server installation

Administration

  • add ssh public keys
  • setup ssh-agent forwarding on local machine for quest in ~/.ssh/config
  • setup umask 0002 in .bashrc and source .bashrc from ~/.bash_profile
  • fix locales:
    locale-gen en_US en_US.UTF-8  cs_CZ.UTF-8
    dpkg-reconfigure locales
    
  • install additional software:
    apt-get install vim mc locate git apache2 libapache2-mod-wsgi python-lxml python-pyicu python-docutils python-virtualenv man-db libantlr3c-3.2-0 mysql-server python-mysqldb apache2-utils python-cheetah npm nodejs-legacy sox libsox-fmt-mp3
    
  • create group devs for developers
    groupadd devs
    usermod -a -G devs <username>
    ...
    
  • create basic directory structure
    mkdir -p /opt/projects/lindat-services-kontext/devel/
    chgrp -R devs /opt/projects 
    chmod -R g+w /opt/projects 
    find /opt/projects -type d | xargs chmod g+s
    
  • adjust limits
    For large corpora the default limit of maximum number of open files (1024 on Ubuntu 14.04) has to be increased.
    Add the followinf lines to /etc/security/limits.conf
    *         hard    nofile      65536
    *         soft    nofile      65536
    root      hard    nofile      65536
    root      soft    nofile      65536
    

    Log off and log in again and verify the limit by issuing:
    ulimit -n
    

Corpus manager (Manatee)

  • install the following development packages:
    apt-get install libantlr3c-dev libpcre3-dev python2.7-dev
    
  • download and unpack nosketch software:
    • finlib
      cd /opt/projects/lindat-services-kontext/vendor/nosketch/finlib
      wget https://dl.dropboxusercontent.com/u/79180955/finlib-2.22.2.tar.gz
      tar xzf finlib-2.22.2.tar.gz
      cd finlib-2.22.2
      ./configure --with-pcre --prefix=/usr/local
      make
      sudo make install
      
    • manatee-open
      cd /opt/projects/lindat-services-kontext/vendor/nosketch/manatee-open
      wget https://dl.dropboxusercontent.com/u/79180955/manatee-open-2.83.3.tar.gz
      tar xzf manatee-open-2.83.3.tar.gz
      cd manatee-open-2.83.3
      ./configure CPPFLAGS='-I/opt/projects/lindat-services-kontext/vendor/nosketch/finlib/finlib-2.22.2' LDFLAGS='-L/usr/local/lib' --with-pcre --prefix=/usr/local
      make
      
  • modify api/Makefile and remove --destdir "$(DESTDIR)"
  • install
    sudo make install
    

Python 2.7 virtualenv

  • not needed for versions 0.5.x
  • activate python virtualenv and install Werkzeug
    cd /opt/projects/lindat-services-kontext/devel
    virtualenv --system-site-packages pythonenv
    . pythonenv/bin/activate
    pip install Werkzeug
    
  • for version 0.5.x (cgi) the following error in apache error.log means that the first line of public/run.cgi (#!/bin/python) is not pointing to correct location:
[Fri Oct 17 09:26:46.636768 2014] [cgid:error] [pid 5998:tid 139899360802688] (2)No such file or directory: AH01241: exec of '/opt/projects/lindat-services-kontext/production/lindat-kontext/public/run.cgi' failed
[Fri Oct 17 09:26:46.637452 2014] [cgid:error] [pid 3584:tid 139899261552384] [client 192.168.0.1:33875] End of script output before headers: run.cgi
[Fri Oct 17 09:39:10.377230 2014] [cgid:error] [pid 6161:tid 139899360802688] (2)No such file or directory: AH01241: exec of '/opt/projects/lindat-services-kontext/production/lindat-kontext/public/run.cgi' failed
  • for piwki tracker plugin piwikapi module is needed:
    . pythonenv/bin/activate
    pip install piwikapi
    

HTTP Server (Apache2)

  • configure apache2
    a2enmod rewrite
    # for master branch
    a2enmod wsgi
    # for release 0.5.x
    a2enmod cgi 
    
  • insert the following snippet into your wsgi configuration: /etc/apache2/mods-enabled/wsgi.conf
    WSGIPythonHome /opt/projects/lindat-services-kontext/devel/pythonenv
    
  • insert the following snippet into your virtual host configuration (e.g. /etc/apache2/sites-enabled/000-default.conf) for wsgi:
            # Kontext
            WSGIScriptAlias /kontext /opt/projects/lindat-services-kontext/devel/lindat-kontext/public/app.py
    
            <Directory /opt/projects/lindat-services-kontext/devel/lindat-kontext/public>
                    Require all granted
            </Directory>
    
  • OR insert the following snippet into your virtual host configuration (e.g. /etc/apache2/sites-enabled/000-default.conf) for cgi:
            Alias /kontext /opt/projects/lindat-services-kontext/devel/lindat-kontext/public/
    
            <Directory /opt/projects/lindat-services-kontext/devel/lindat-kontext/public>
                    Require all granted
                    Options +ExecCGI
                    AddHandler cgi-script .cgi
                    AllowOverride FileInfo
                    RewriteEngine On
                    RewriteBase /kontext/
                    RewriteRule ^$ http://quest.ms.mff.cuni.cz/kontext-dev/run.cgi/first_form [L,R=301]
            </Directory>
    

Database (MySQL)

  • setup MySQL database (mind the backticks in grant all privileges command)
    mysqladmin -p create lindat-kontext
    mysql -p lindat-kontext
    create user 'lindat-kontext'@'localhost' identified by 'somepassword\r
    grant all privileges on `lindat-kontext`.* to 'lindat-kontext'@'localhost\r
    
  • create db schema (create-tables-mysql.sql not included in current version needed to be checkout from release 0.3.6, table had to be created manually)
    mysql -p -u lindat-kontext lindat-kontext < scripts/create-tables-mysql.sql
    mysql -p -u lindat-kontext lindat-kontext < scripts/plugins/ucnk-create-tables.sql
    
  • setup log dir:
    mkdir -p /opt/projects/lindat-services-kontext/devel/log
    chown www-data:devs /opt/projects/lindat-services-kontext/devel/log
    chmod g+ws /opt/projects/lindat-services-kontext/devel/log
    
  • copy config file:
    cd /opt/projects/lindat-services-kontext/devel/lindat-kontext/
    cp config.sample.xml config.xml
    
  • modify config file (TODO, include diff)

Grunt

  • install javascript modules:
    npm install grunt-cli
    npm install
    
  • run grunt
    ./node_modules/.bin/grunt
    

Updated by Redmine Admin almost 8 years ago · 1 revisions