Відмінності між версіями «Встановлення Koha з джерела на ОС Debian»

Матеріал з Koha Ukraine Wiki
Перейти до: навігація, пошук
(Запуск встановлювача)
м (Відповіді на питання)
Рядок 364: Рядок 364:
 
By default, Koha can be installed in one of three ways:
 
By default, Koha can be installed in one of three ways:
  
'''standard''': Install files in conformance with the Filesystem
+
'''standard''': Install files in conformance with the Filesystem         Hierarchy Standard (FHS).  This is the default mode         and should be used when installing a production         Koha system.  On Unix systems, root access is         needed to complete a standard installation.
          Hierarchy Standard (FHS).  This is the default mode
 
          and should be used when installing a production
 
          Koha system.  On Unix systems, root access is
 
          needed to complete a standard installation.
 
  
'''single''':  Install files under a single directory.  This option
+
'''single''':  Install files under a single directory.  This option         is useful for installing Koha without root access, e.g.,         on a web host that allows CGI scripts and MySQL databases         but requires the user to keep all files under the user's         HOME directory.
          is useful for installing Koha without root access, e.g.,
 
          on a web host that allows CGI scripts and MySQL databases
 
          but requires the user to keep all files under the user's
 
          HOME directory.
 
  
'''dev''':      Create a set of symbolic links and configuration files to
+
'''dev''':      Create a set of symbolic links and configuration files to         allow Koha to run directly from the source distribution.         This mode is useful for developers who want to run         Koha from a git clone.
          allow Koha to run directly from the source distribution.
 
          This mode is useful for developers who want to run
 
          Koha from a git clone.
 
  
 
Installation mode (dev, single, standard) ['''standard''']  
 
Installation mode (dev, single, standard) ['''standard''']  
Рядок 408: Рядок 397:
 
account Apache runs under.
 
account Apache runs under.
  
User account (default from environment) [koha3admin]  
+
User account (default from environment) ['''koha3admin''']  
  
 
Please specify the group that should own
 
Please specify the group that should own
Рядок 415: Рядок 404:
 
before you run 'make install'.
 
before you run 'make install'.
  
Group (default from environment) [koha3admin]  
+
Group (default from environment) ['''koha3admin''']  
  
 
Please specify which database engine you will use
 
Please specify which database engine you will use
Рядок 422: Рядок 411:
 
PostgreSQL support is highly experimental.
 
PostgreSQL support is highly experimental.
  
DBMS to use (Pg, mysql) [mysql]  
+
DBMS to use (Pg, mysql) ['''mysql''']  
  
 
Please specify the name or address of your
 
Please specify the name or address of your
Рядок 430: Рядок 419:
 
and before you try using Koha for the first time.
 
and before you try using Koha for the first time.
  
Database server [localhost]  
+
Database server ['''localhost''']  
  
 
Please specify the port used to connect to the
 
Please specify the port used to connect to the
DMBS [3306]  
+
DMBS ['''3306''']  
  
 
Please specify the name of the database to be
 
Please specify the name of the database to be
used by Koha (default from environment) [Koha3]  
+
used by Koha (default from environment) ['''Koha3''']  
  
 
Please specify the user that owns the database to be
 
Please specify the user that owns the database to be
used by Koha (default from environment) [koha3admin]  
+
used by Koha (default from environment) ['''koha3admin''']  
  
 
Please specify the password of the user that owns the
 
Please specify the password of the user that owns the
database to be used by Koha (default from environment) [koha3gfhjkm]  
+
database to be used by Koha (default from environment) ['''koha3gfhjkm''']  
  
 
Koha can use the Zebra search engine for high-performance
 
Koha can use the Zebra search engine for high-performance
Рядок 454: Рядок 443:
 
settings.  Those references will be ignored by Koha.
 
settings.  Those references will be ignored by Koha.
  
Install the Zebra configuration files? (no, yes) [yes]  
+
Install the Zebra configuration files? (no, yes) ['''yes''']  
  
 
Found 'zebrasrv' and 'zebraidx' in /usr/bin.
 
Found 'zebrasrv' and 'zebraidx' in /usr/bin.
Рядок 465: Рядок 454:
 
and UNIMARC.
 
and UNIMARC.
  
MARC format for Zebra indexing (marc21, normarc, unimarc) (default from environment) [unimarc]  
+
MARC format for Zebra indexing (marc21, normarc, unimarc) (default from environment) ['''unimarc''']  
  
 
Koha supplies Zebra configuration files tuned for
 
Koha supplies Zebra configuration files tuned for
Рядок 471: Рядок 460:
 
records.
 
records.
  
Primary language for Zebra indexing (en, fr, nb) [en]  
+
Primary language for Zebra indexing (en, fr, nb) ['''en''']  
  
 
Koha can use one of  two different indexing modes
 
Koha can use one of  two different indexing modes
 
for the MARC authorities records:
 
for the MARC authorities records:
  
grs1 - uses the Zebra GRS-1 filter, available
+
grs1 - uses the Zebra GRS-1 filter, available       for legacy support
      for legacy support
+
dom  - uses the DOM XML filter; offers improved       functionality.
dom  - uses the DOM XML filter; offers improved
 
      functionality.
 
  
Authorities indexing mode (dom, grs1) [dom]  
+
Authorities indexing mode (dom, grs1) ['''dom''']  
  
Please specify Zebra database user (default from environment) [koha3admin]  
+
Please specify Zebra database user (default from environment) ['''koha3admin''']  
  
Please specify the Zebra database password (default from environment) [koha3gfhjkm]  
+
Please specify the Zebra database password (default from environment) ['''koha3gfhjkm''']  
  
 
Since you've chosen to use Zebra, you can enable the SRU/
 
Since you've chosen to use Zebra, you can enable the SRU/
Рядок 495: Рядок 482:
 
settings.  Those references will be ignored by Koha.
 
settings.  Those references will be ignored by Koha.
  
Install the SRU configuration files? (no, yes) [yes]  
+
Install the SRU configuration files? (no, yes) ['''yes''']  
  
SRU Database host? [localhost]  
+
SRU Database host? ['''localhost''']  
  
SRU port for bibliographic data? [9998]  
+
SRU port for bibliographic data? ['''9998''']  
  
SRU port for authority data? [9999]  
+
SRU port for authority data? ['''9999''']  
  
 
Since you've chosen to use Zebra, you can also choose to
 
Since you've chosen to use Zebra, you can also choose to
Рядок 509: Рядок 496:
 
the results list.
 
the results list.
  
Install the PazPar2 configuration files? (default from environment) [yes]  
+
Install the PazPar2 configuration files? (default from environment) ['''yes''']  
  
Zebra bibliographic server host? [localhost]  
+
Zebra bibliographic server host? ['''localhost''']  
  
Zebra bibliographic port for PazPar2 to use? [11001]  
+
Zebra bibliographic port for PazPar2 to use? ['''11001''']  
  
PazPar2 host? [localhost]  
+
PazPar2 host? ['''localhost''']  
  
PazPar2 port? [11002]  
+
PazPar2 port? ['''11002''']  
  
 
Use memcached and memoize to cache the results of some function calls?
 
Use memcached and memoize to cache the results of some function calls?
 
This provides a signficant performance improvement.
 
This provides a signficant performance improvement.
You will need a Memcached server running. (no, yes) [no] yes
+
You will need a Memcached server running. (no, yes) [no] '''yes'''
  
 
Memcached server address? ['''127.0.0.1:11211''']  
 
Memcached server address? ['''127.0.0.1:11211''']  

Версія за 22:14, 6 травня 2011

Розглядається встановлення АБІС Koha серії 3.4 з джерельних кодів. Опис, в основному взятий з http://wiki.koha-community.org/wiki/Category:Installation з доповненнями.

Попередні налаштування

Локаль з UTF-8

Перевірка локалі:

 sudo locale

у виводі повинно бути

LANG=uk_UA.UTF-8
LANGUAGE=
LC_CTYPE="uk_UA.UTF-8"
LC_NUMERIC="uk_UA.UTF-8"
LC_TIME="uk_UA.UTF-8"
LC_COLLATE="uk_UA.UTF-8"
LC_MONETARY="uk_UA.UTF-8"
LC_MESSAGES="uk_UA.UTF-8"
LC_PAPER="uk_UA.UTF-8"
LC_NAME="uk_UA.UTF-8"
LC_ADDRESS="uk_UA.UTF-8"
LC_TELEPHONE="uk_UA.UTF-8"
LC_MEASUREMENT="uk_UA.UTF-8"
LC_IDENTIFICATION="uk_UA.UTF-8"

Якщо UTF-8 не згадується, то встановлюємо локаль

   sudo update-locale LANG=uk_UA.UTF-8

Користувач для Koha

Додаємо користувача

(нижче замість „АдміністраторСистемиKoha“ вводимо своє)

sudo adduser АдміністраторСистемиKoha

Деколи група автоматично не створюється — тоді потрібно ще

sudo addgroup АдміністраторСистемиKoha
sudo adduser АдміністраторСистемиKoha АдміністраторСистемиKoha

Командою visudo відкриваємо для редагування файл привілеїв адміністратора і надаємо їх користувачу АдміністраторСистемиKoha, додавши у кінці файлу рядок

АдміністраторСистемиKoha ALL=(ALL) ALL

Після додавання клавіатурним скороченням Ctrl-O зберігаємо файл (/etc/sudoers) та через Ctrl-X виходимо.

Встановлення й налаштування додаткових пакунків

Встановленню безпосередньо ПЗ Koha передує встановлення усіх необхідних пакунків та модулів, від яких залежить Koha.

Встановлення пакунків з репозитаріїв

Веб-сервер, БД MySQL та допоміжні пакунки

Однією командою

sudo apt-get install \
at \
apache2 \
cvs \
git \
git-core \
make \
gcc \
daemon \
perlmagick \
mysql-server \
phpmyadmin
  • при встановленні сервера MySQL вказуємо пароль адміністратора (користувач „root“), надалі „ПарольАдмінаMySQL“.
  • для „phpmyadmin“ вибрати лише „apache2“

Перлівські модулі

Однією командою

sudo apt-get install \
libcgi-session-perl \
libclass-factory-util-perl \
libdata-ical-perl \
libdate-calc-perl \
libdate-ical-perl \
libdate-manip-perl \
libdatetime-format-mail-perl \
libdatetime-format-strptime-perl \
libdatetime-format-w3cdtf-perl \
libdatetime-locale-perl \
libdatetime-perl \
libdatetime-timezone-perl \
libdbd-mysql-perl \
libdbi-perl \
libemail-date-perl \
libgd-barcode-perl \
libhtml-scrubber-perl \
libimage-magick-perl \
libjson-perl \
liblingua-ispell-perl \
liblingua-stem-perl \
liblist-moreutils-perl \
liblist-moreutils-perl \
liblocale-gettext-perl \
liblocale-po-perl \
libmail-sendmail-perl \
libmime-lite-perl \
libnet-ldap-perl \
libpdf-api2-perl \
libpoe-perl \
libtext-charwidth-perl \
libtext-csv-perl \
libtext-iconv-perl \
libtext-wrapi18n-perl \
libtimedate-perl \
libtime-duration-perl \
libtime-format-perl \
libunix-syslog-perl \
libxml-dom-perl \
libxml-dumper-perl \
libxml-libxml-perl \
libxml-libxslt-perl \
libxml-namespacesupport-perl \
libxml-parser-perl \
libxml-perl \
libxml-regexp-perl \
libxml-sax-writer-perl \
libxml-simple-perl \
libxml-xslt-perl \
libyaml-syck-perl \
libbiblio-endnotestyle-perl \
libcgi-session-serialize-yaml-perl \
libhtml-template-pro-perl \
libmarc-charset-perl \
libmarc-crosswalk-dublincore-perl \
libmarc-xml-perl \
libmarc-record-perl \
libnet-z3950-zoom-perl \
libpdf-reuse-perl \
libpdf-reuse-barcode-perl \
libschedule-at-perl \
libxml-rss-perl \
libyaml-perl \
libalgorithm-checkdigits-perl \
libhttp-oai-perl \
libsms-send-perl \
libtemplate-perl \
libmemoize-memcached-perl \
libbusiness-isbn-perl \
libdbd-sqlite2-perl \
libuniversal-require-perl \
libtext-csv-encoded-perl \
libpdf-api2-simple-perl \
libpdf-table-perl \
libnet-server-perl \
libnumber-format-perl \
liblocale-currency-format-perl \
liblingua-stem-snowball-perl \
libgraphics-magick-perl \
libauthen-cas-client-perl

Zebra та Yaz

Однією командою

sudo apt-get install \
idzebra-2.0-common \
idzebra-2.0-doc \
idzebra-2.0 \
idzebra-2.0-utils \
libidzebra-2.0-dev \
libidzebra-2.0-0 \
libidzebra-2.0-mod-alvis \
libidzebra-2.0-mod-grs-marc \
libidzebra-2.0-mod-grs-regx \
libidzebra-2.0-mod-grs-xml \
libidzebra-2.0-mod-text \
libidzebra-2.0-modules \
yaz \
yaz-doc \
libyaz4 \
libyaz4-dev 

Інші пакунки

Однією командою

sudo apt-get install \
gettext \
libgcrypt11-dev \
libgcrypt11 \
libgd2-noxpm-dev \
libmysqlclient-dev \
libxml2-dev \
libxml2 \
libxml2-utils \
libxslt1.1 \
libxslt1-dev \
memcached \
libapache2-mod-perl2

Пакунки з гілок Дебіен „unstable“ чи „testing“

1) Створюємо файл /etc/apt/apt.conf і додаємо наступне

# Зробити „squeeze“ дистрибутивом за умовчанням
APT::Default-Release "squeeze";

2) Створюємо файл /etc/apt/preferences і додаємо наступне (щоб у стабільної гілки „squeeze“ був вищий пріоритет)

Package: *
Pin: release a=squeeze
Pin-Priority: 900
Package: *
Pin: release a=unstable
Pin-Priority: 90

3) У файл /etc/apt/sources.list додаємо наступне джерело

# Джерело пакунків з гілки Дебіен „unstable“
deb http://http.us.debian.org/debian unstable main contrib non-free

4) Встановлення пакунків з гілки „unstable“

sudo apt-get update
sudo apt-cache policy libcgi-session-driver-memcached-perl
sudo apt-get -t unstable install libcgi-session-driver-memcached-perl

Налаштування пакунків

Apache

1) Модулі

Задіюємо модуль Rewrite

sudo a2enmod rewrite

а також модулі Expires та Deflate

sudo a2enmod expires
sudo a2enmod deflate

2) Редагуємо /etc/apache2/conf.d/charset

AddCharset UTF-8 .utf8
AddDefaultCharset UTF-8

3) Перезапуск Apache

sudo /etc/init.d/apache2 restart

MySQL

1) Пароль для користувача root БД MySQL: ПарольАдмінаMySQL

Якщо пароль не вибрано при встановленні MySQL, то змінити можна так

sudo dpkg-reconfigure mysql-server-5.1

2) Для підтримки UTF-8 у MySQL у файлі /etc/mysql/my.cnf (в кінці) має бути наступне

[client]
default-character-set=utf8
[mysqld_safe]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
init-connect='SET NAMES utf8, collation_connection=utf8_unicode_ci'
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_unicode_ci
character_set_client=utf8
default-collation=utf8_unicode_ci
skip-character-set-client-handshake

3) Перезапускаємо сервер MySQL

sudo /etc/init.d/mysql restart

4) Переконуємося, що зміни внесені, виконавши

sudo mysql -uroot -pПарольАдмінаMySQL
show variables;
quit

Встановлення Koha

Вхід від користувача АдміністраторСистемиKoha

Переходимо у середовище користувача АдміністраторСистемиKoha (вводимо пароль користувача АдміністраторСистемиKoha)

su АдміністраторСистемиKoha
cd ~/

Отримання Koha

1) Для отримання останньої стабільної Koha — звантажуємо її з http://download.koha-community.org

mkdir ~/koha; wget -O ~/koha/koha-latest.tar.gz http://download.koha-community.org/koha-latest.tar.gz

2) Розпаковування архіву

cd ~/koha; tar -xzf  koha-latest.tar.gz

3) Логічне посилання на теку

Зручно мати логічне посилання на теку з Koha

rm ~/koha/koha.local;ln -s ~/koha/koha-3.04.00.000 ~/koha/koha.local

Створення БД для Koha в MySQL

Утворюємо базу даних Koha3 та привілеї користувачів щодо неї:

sudo mysqladmin -uroot -pПарольАдмінаMySQL create Koha3
sudo mysql -uroot -pПарольАдмінаMySQL

У середовищі mysql виконати наступне

grant all on Koha3.* to 'КористувачБДKoha3'@'localhost' identified by 'ПарольКористувачаБДKoha3';\
flush privileges;
exit

Перевірка аналізатора SAX Parser

У теці Koha виконати

~/koha/koha.local/misc/sax_parser_print.pl

Ви повинні побачити щось таке

XML::LibXML::SAX::Parser=HASH(0x81fe220)

Якщо ж є PurePerl чи Expat, то необхідно поправити файл /etc/perl/XML/SAX/ParserDetails.ini (запис щодо XML::LibXML::SAX::Parser має бути найнижче)

Перевірка чи встановлені усі необхідні пакунки

Команда

~/koha/koha.local/koha_perl_deps.pl -c -u -m

видасть список відсутніх модулів та модулів, які необхідно оновити.

Вам необхідно знайти та встановити ці модулі (ймовірно, що список буде порожнім, оскільки всі необхідні пакунки повинні згадуватися у цьому керівництві вище).

Відсутні та модулі новіших версій шукайте у гілці Debian unstable або ж в CPAN (Perl-модулі з CPAN встановлюються командую на кшталт „sudo cpan HTTP::OAI“).

Запуск встановлювача

Запускаємо встановлювач (у наступній команді вказуємо власні дані)

cd ~/koha/koha.local/
INSTALL_BASE=/usr/share/koha3 \
KOHA_USER=АдміністраторСистемиKoha \
KOHA_GROUP=АдміністраторСистемиKoha \
DB_NAME=Koha3 \
DB_USER=КористувачБДKoha3 \
DB_PASS=ПарольКористувачаБДKoha3 \
ZEBRA_MARC_FORMAT=unimarc \
ZEBRA_USER=КористувачZebra \
ZEBRA_PASS=ПарольКористувачаZebra \
INSTALL_PAZPAR2=yes \
USE_MEMCACHED=yes \
perl Makefile.PL

Відповідаємо на питання:

Відповіді на питання

By default, Koha can be installed in one of three ways:

standard: Install files in conformance with the Filesystem Hierarchy Standard (FHS). This is the default mode and should be used when installing a production Koha system. On Unix systems, root access is needed to complete a standard installation.

single: Install files under a single directory. This option is useful for installing Koha without root access, e.g., on a web host that allows CGI scripts and MySQL databases but requires the user to keep all files under the user's HOME directory.

dev: Create a set of symbolic links and configuration files to allow Koha to run directly from the source distribution. This mode is useful for developers who want to run Koha from a git clone.

Installation mode (dev, single, standard) [standard]

Please specify the directory under which most Koha files will be installed.

Note that if you are planning in installing more than one instance of Koha, you may want to modify the last component of the directory path, which will be used as the package name in the FHS layout.

Base installation directory (default from environment) [/usr/share/koha3]

Since you are using the 'standard' install mode, you should run 'make install' as root. However, it is recommended that a non-root user (on Unix and Linux platforms) have ownership of Koha's files, including the Zebra indexes if applicable.

Please specify a user account. This user account does not need to exist right now, but it needs to exist before you run 'make install'. Please note that for security reasons, this user should not be the same as the user account Apache runs under.

User account (default from environment) [koha3admin]

Please specify the group that should own Koha's files. As above, this group need not exist right now, but should be created before you run 'make install'.

Group (default from environment) [koha3admin]

Please specify which database engine you will use to store data in Koha. The choices are MySQL and PostgreSQL; please note that at the moment PostgreSQL support is highly experimental.

DBMS to use (Pg, mysql) [mysql]

Please specify the name or address of your database server. Note that the database does not have to exist at this point, it can be created after running 'make install' and before you try using Koha for the first time.

Database server [localhost]

Please specify the port used to connect to the DMBS [3306]

Please specify the name of the database to be used by Koha (default from environment) [Koha3]

Please specify the user that owns the database to be used by Koha (default from environment) [koha3admin]

Please specify the password of the user that owns the database to be used by Koha (default from environment) [koha3gfhjkm]

Koha can use the Zebra search engine for high-performance searching of bibliographic and authority records. If you have installed the Zebra software and would like to use it, please answer 'yes' to the following question. Otherwise, Koha will default to using its internal search engine.

Please note that if you choose *NOT* to install Zebra, koha-conf.xml will still contain some references to Zebra settings. Those references will be ignored by Koha.

Install the Zebra configuration files? (no, yes) [yes]

Found 'zebrasrv' and 'zebraidx' in /usr/bin.

Since you've chosen to use Zebra with Koha, you must specify the primary MARC format of the records to be indexed by Zebra.

Koha provides Zebra configuration files for MARC 21 and UNIMARC.

MARC format for Zebra indexing (marc21, normarc, unimarc) (default from environment) [unimarc]

Koha supplies Zebra configuration files tuned for searching either English (en) or French (fr) MARC records.

Primary language for Zebra indexing (en, fr, nb) [en]

Koha can use one of two different indexing modes for the MARC authorities records:

grs1 - uses the Zebra GRS-1 filter, available for legacy support dom - uses the DOM XML filter; offers improved functionality.

Authorities indexing mode (dom, grs1) [dom]

Please specify Zebra database user (default from environment) [koha3admin]

Please specify the Zebra database password (default from environment) [koha3gfhjkm]

Since you've chosen to use Zebra, you can enable the SRU/ Z39.50 Server if you so choose, but you must specify a few configuration options for it.

Please note that if you choose *NOT* to configure SRU, koha-conf.xml will still contain some references to SRU settings. Those references will be ignored by Koha.

Install the SRU configuration files? (no, yes) [yes]

SRU Database host? [localhost]

SRU port for bibliographic data? [9998]

SRU port for authority data? [9999]

Since you've chosen to use Zebra, you can also choose to install PazPar2, which is a metasearch tool. With PazPar2, Koha can perform on-the-fly merging of bibliographic records during searching, allowing for FRBRization of the results list.

Install the PazPar2 configuration files? (default from environment) [yes]

Zebra bibliographic server host? [localhost]

Zebra bibliographic port for PazPar2 to use? [11001]

PazPar2 host? [localhost]

PazPar2 port? [11002]

Use memcached and memoize to cache the results of some function calls? This provides a signficant performance improvement. You will need a Memcached server running. (no, yes) [no] yes

Memcached server address? [127.0.0.1:11211]

Memcached namespace? [KOHA]

Would you like to run the database-dependent test suite? (no, yes) [no]