Installation » History » Version 1
Redmine Admin, 01/04/2017 05:22 PM
| 1 | 1 | Redmine Admin | h1. Installation |
|---|---|---|---|
| 2 | |||
| 3 | h2. Additional steps after clean server installation |
||
| 4 | |||
| 5 | h3. Administration |
||
| 6 | |||
| 7 | * add ssh public keys |
||
| 8 | * setup ssh-agent forwarding on local machine for quest in ~/.ssh/config |
||
| 9 | * setup umask 0002 in .bashrc and source .bashrc from ~/.bash_profile |
||
| 10 | * fix locales: |
||
| 11 | <pre> |
||
| 12 | locale-gen en_US en_US.UTF-8 cs_CZ.UTF-8 |
||
| 13 | dpkg-reconfigure locales |
||
| 14 | </pre> |
||
| 15 | * install additional software: |
||
| 16 | <pre> |
||
| 17 | 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 |
||
| 18 | </pre> |
||
| 19 | * create group devs for developers |
||
| 20 | <pre> |
||
| 21 | groupadd devs |
||
| 22 | usermod -a -G devs <username> |
||
| 23 | ... |
||
| 24 | </pre> |
||
| 25 | * create basic directory structure |
||
| 26 | <pre> |
||
| 27 | mkdir -p /opt/projects/lindat-services-kontext/devel/ |
||
| 28 | chgrp -R devs /opt/projects |
||
| 29 | chmod -R g+w /opt/projects |
||
| 30 | find /opt/projects -type d | xargs chmod g+s |
||
| 31 | </pre> |
||
| 32 | |||
| 33 | * adjust limits |
||
| 34 | For large corpora the default limit of maximum number of open files (1024 on Ubuntu 14.04) has to be increased. |
||
| 35 | Add the followinf lines to /etc/security/limits.conf |
||
| 36 | <pre> |
||
| 37 | * hard nofile 65536 |
||
| 38 | * soft nofile 65536 |
||
| 39 | root hard nofile 65536 |
||
| 40 | root soft nofile 65536 |
||
| 41 | </pre> |
||
| 42 | Log off and log in again and verify the limit by issuing: |
||
| 43 | <pre> |
||
| 44 | ulimit -n |
||
| 45 | </pre> |
||
| 46 | |||
| 47 | h3. Corpus manager (Manatee) |
||
| 48 | |||
| 49 | * install the following development packages: |
||
| 50 | <pre> |
||
| 51 | apt-get install libantlr3c-dev libpcre3-dev python2.7-dev |
||
| 52 | </pre> |
||
| 53 | * download and unpack nosketch software: |
||
| 54 | ** finlib |
||
| 55 | <pre> |
||
| 56 | cd /opt/projects/lindat-services-kontext/vendor/nosketch/finlib |
||
| 57 | wget https://dl.dropboxusercontent.com/u/79180955/finlib-2.22.2.tar.gz |
||
| 58 | tar xzf finlib-2.22.2.tar.gz |
||
| 59 | cd finlib-2.22.2 |
||
| 60 | ./configure --with-pcre --prefix=/usr/local |
||
| 61 | make |
||
| 62 | sudo make install |
||
| 63 | </pre> |
||
| 64 | ** manatee-open |
||
| 65 | <pre> |
||
| 66 | cd /opt/projects/lindat-services-kontext/vendor/nosketch/manatee-open |
||
| 67 | wget https://dl.dropboxusercontent.com/u/79180955/manatee-open-2.83.3.tar.gz |
||
| 68 | tar xzf manatee-open-2.83.3.tar.gz |
||
| 69 | cd manatee-open-2.83.3 |
||
| 70 | ./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 |
||
| 71 | make |
||
| 72 | </pre> |
||
| 73 | * modify api/Makefile and remove --destdir "$(DESTDIR)" |
||
| 74 | * install |
||
| 75 | <pre> |
||
| 76 | sudo make install |
||
| 77 | </pre> |
||
| 78 | |||
| 79 | h3. Python 2.7 virtualenv |
||
| 80 | |||
| 81 | * *not needed for versions 0.5.x* |
||
| 82 | * activate python virtualenv and install Werkzeug |
||
| 83 | <pre> |
||
| 84 | cd /opt/projects/lindat-services-kontext/devel |
||
| 85 | virtualenv --system-site-packages pythonenv |
||
| 86 | . pythonenv/bin/activate |
||
| 87 | pip install Werkzeug |
||
| 88 | </pre> |
||
| 89 | |||
| 90 | * 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: |
||
| 91 | |||
| 92 | <pre> |
||
| 93 | [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 |
||
| 94 | [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 |
||
| 95 | [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 |
||
| 96 | </pre> |
||
| 97 | |||
| 98 | * for piwki tracker plugin piwikapi module is needed: |
||
| 99 | <pre> |
||
| 100 | . pythonenv/bin/activate |
||
| 101 | pip install piwikapi |
||
| 102 | </pre> |
||
| 103 | |||
| 104 | h3. HTTP Server (Apache2) |
||
| 105 | |||
| 106 | * configure apache2 |
||
| 107 | <pre> |
||
| 108 | a2enmod rewrite |
||
| 109 | # for master branch |
||
| 110 | a2enmod wsgi |
||
| 111 | # for release 0.5.x |
||
| 112 | a2enmod cgi |
||
| 113 | </pre> |
||
| 114 | * insert the following snippet into your wsgi configuration: /etc/apache2/mods-enabled/wsgi.conf |
||
| 115 | <pre> |
||
| 116 | WSGIPythonHome /opt/projects/lindat-services-kontext/devel/pythonenv |
||
| 117 | </pre> |
||
| 118 | * insert the following snippet into your virtual host configuration (e.g. /etc/apache2/sites-enabled/000-default.conf) for wsgi: |
||
| 119 | <pre> |
||
| 120 | # Kontext |
||
| 121 | WSGIScriptAlias /kontext /opt/projects/lindat-services-kontext/devel/lindat-kontext/public/app.py |
||
| 122 | |||
| 123 | <Directory /opt/projects/lindat-services-kontext/devel/lindat-kontext/public> |
||
| 124 | Require all granted |
||
| 125 | </Directory> |
||
| 126 | </pre> |
||
| 127 | * OR insert the following snippet into your virtual host configuration (e.g. /etc/apache2/sites-enabled/000-default.conf) for cgi: |
||
| 128 | <pre> |
||
| 129 | Alias /kontext /opt/projects/lindat-services-kontext/devel/lindat-kontext/public/ |
||
| 130 | |||
| 131 | <Directory /opt/projects/lindat-services-kontext/devel/lindat-kontext/public> |
||
| 132 | Require all granted |
||
| 133 | Options +ExecCGI |
||
| 134 | AddHandler cgi-script .cgi |
||
| 135 | AllowOverride FileInfo |
||
| 136 | RewriteEngine On |
||
| 137 | RewriteBase /kontext/ |
||
| 138 | RewriteRule ^$ http://quest.ms.mff.cuni.cz/kontext-dev/run.cgi/first_form [L,R=301] |
||
| 139 | </Directory> |
||
| 140 | </pre> |
||
| 141 | |||
| 142 | h3. Database (MySQL) |
||
| 143 | |||
| 144 | * setup MySQL database (mind the backticks in grant all privileges command) |
||
| 145 | <pre> |
||
| 146 | mysqladmin -p create lindat-kontext |
||
| 147 | mysql -p lindat-kontext |
||
| 148 | create user 'lindat-kontext'@'localhost' identified by 'somepassword\r |
||
| 149 | grant all privileges on `lindat-kontext`.* to 'lindat-kontext'@'localhost\r |
||
| 150 | </pre> |
||
| 151 | * 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) |
||
| 152 | <pre> |
||
| 153 | mysql -p -u lindat-kontext lindat-kontext < scripts/create-tables-mysql.sql |
||
| 154 | mysql -p -u lindat-kontext lindat-kontext < scripts/plugins/ucnk-create-tables.sql |
||
| 155 | </pre> |
||
| 156 | * setup log dir: |
||
| 157 | <pre> |
||
| 158 | mkdir -p /opt/projects/lindat-services-kontext/devel/log |
||
| 159 | chown www-data:devs /opt/projects/lindat-services-kontext/devel/log |
||
| 160 | chmod g+ws /opt/projects/lindat-services-kontext/devel/log |
||
| 161 | </pre> |
||
| 162 | * copy config file: |
||
| 163 | <pre> |
||
| 164 | cd /opt/projects/lindat-services-kontext/devel/lindat-kontext/ |
||
| 165 | cp config.sample.xml config.xml |
||
| 166 | </pre> |
||
| 167 | * modify config file (TODO, include diff) |
||
| 168 | |||
| 169 | h3. Grunt |
||
| 170 | |||
| 171 | * install javascript modules: |
||
| 172 | <pre> |
||
| 173 | npm install grunt-cli |
||
| 174 | npm install |
||
| 175 | </pre> |
||
| 176 | * run grunt |
||
| 177 | <pre> |
||
| 178 | ./node_modules/.bin/grunt |
||
| 179 | </pre> |