Koha 3.10 on Centos 6.3 x86 64 en

This document is based on Koha 3.6 on Centos 6.2 i386. 
This document includes detailed instructions on setting up Koha version 3.10 on Centos 6.3 x86_64.
== Centos Installation ==
1.  Installation 
At the screen where you choose Centos Minimal click on Customize and add the following packages: 
Applications: Emacs, Graphics -> ImageMagick
Base: Perl
Databases: MySQL Client, MySQL Server
Development: Additional Development -> libxslt-devel, tcp_wrappers-devel
Languages: Chinese, Japanese
Servers: Print Server, Email Server
Web Services: PHP Support -> php-mysql, Web Server -> bütün Perl modullleri
 
2. After installation, install packets below. 
yum -y install rpm-cron memcached tcl libicu-devel make openssh-clients vim wget setools policycoreutils-python cyrus-sasl-plain
 
3.  Patch your server after installation. 
yum -y update
 
4.  Disable Centos SELinux settings.
Open /etc/sysconfig/selinux file.
vim /etc/sysconfig/selinux
change 
SELINUX=enforcing
line as
SELINUX=disabled
Reboot server.
Note, once your setup is solid it's recommended that you actually configure SELinux instead of just disabling it.
== Koha installation: (Pre-installation tasks) ==
1. 1.	Download Koha. Install EPEL and Rpmforge repos. These repos will provide you to install some of perl modules as RPM. 
rpm --install 'http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm'
rpm --install 'http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm'
wget -nd 'http://download.koha-community.org/koha-latest.tar.gz'
 
2. Install packages necessary for Koha which are unavailable in Centos minimal installation. 
yum -y install perl-CPAN perl-CPAN-Meta-YAML gcc GraphicsMagick-perl
yum -y install --disablerepo=rpmforge,epel 'perl-*'
yum -y install perl-DBD-SQLite2 perl-Unix-Syslog perl-UNIVERSAL-require perl-Net-Server patch perl-Moose 
 perl-Test-YAML-Valid perl-Time-Progress
# perl-YAML 0.72
yum -y --enablerepo=rpmforge-extras install perl-YAML
 
3. Download yaz and zebra packets from indexdata site and install them. 
wget http://ftp.indexdata.dk/pub/zebra/redhat/centos/6/RPMS/x86_64/idzebra-2.0-2.0.54-1indexdata.x86_64.rpm
wget http://ftp.indexdata.dk/pub/zebra/redhat/centos/6/RPMS/x86_64/libidzebra-2.0-2.0.54-1indexdata.x86_64.rpm
wget http://ftp.indexdata.dk/pub/zebra/redhat/centos/6/RPMS/x86_64/libidzebra-2.0-modules-2.0.54-1indexdata.x86_64.rpm
wget http://ftp.indexdata.dk/pub/zebra/redhat/centos/6/RPMS/x86_64/libidzebra-2.0-devel-2.0.54-1indexdata.x86_64.rpm
wget http://ftp.indexdata.dk/pub/yaz/redhat/centos/6/RPMS/x86_64/libyaz4-4.2.51-1indexdata.x86_64.rpm
wget http://ftp.indexdata.dk/pub/yaz/redhat/centos/6/RPMS/x86_64/libyaz4-devel-4.2.51-1indexdata.x86_64.rpm
wget http://ftp.indexdata.dk/pub/yaz/redhat/centos/6/RPMS/x86_64/yaz-4.2.51-1indexdata.x86_64.rpm
rpm -ivh libidzebra* idzebra* libyaz4* yaz*
 
Note: Zebra version should be 2.0.52 or later. Otherwise materials related to records do not appear in the search results when records are updated. 
4. Fix GraphicsMagic installation. 
cd /usr/lib64/perl5/vendor_perl/auto/Graphics/Magick
mv Magick.so Magick-0.so
ld -share -o Magick.so `pwd`/Magick-0.so /usr/lib64/libGraphicsMagick.so.3.10.0
 
5. Install perl packages that do not come with Centos deployment. And upgrade perl modules which do not meet Koha’s requirements.
Find missing perl rpm packages using koha _perl_deps.pl scripts and install them:
 
tar zxf koha-latest.tar.gz
cd koha-3.10.01
perl koha_perl_deps.pl -m -b -r | sed -e 's/::/-/g' | awk '{print "yum -y install perl-"$1}' > perl-pkgs-install
sh perl-pkgs-install
perl-MARC-Charset package version 1.1 causes Turkish character problem. Thus, this package should be uninstalled and new version should be installed from CPAN.
rpm -e perl-MARC-Charset
Install the rest of perl modules from CPAN. Tell CPAN to auto default to yes and follow and install dependencies automatically.
perl -MCPAN -e shell
o conf build_requires_install_policy yes
o conf prerequisites_policy follow
o conf commit
Take lists of perl modules which come with Centos or installed with yum program from repos which does not meet Koha’s requirements. 
perl koha_perl_deps.pl -u
As of the moment this document is written perl-Date Time packet does not meet Koha’s requirements. Thus, this package should be uninstalled and new version should be installed from CPAN. Remove these and such like packages from the system and install new versions of necessary perl modules from CPAN.
yum erase perl-DateTime
perl koha_perl_deps.pl -m -b -r | awk '{print "cpan -i "$1}' > perl-modules-install
sh perl-modules-install
Packages failed to install should be installed using “-f” switch.
perl koha_perl_deps.pl -m -b -r | awk '{print "cpan -i -f "$1}' > perl-modules-install2
sh perl-modules-install2
Install optional perl modules ,
perl koha_perl_deps.pl -m | grep 'No' | sed -e 's/::/-/g' | awk '{print "yum -y install perl-"$1}' > perl-pkgs-install-nr
sh perl-pkgs-install-nr
To see the list of perl modules installed with rpm package manager and does not meet Koha’s requirements run following command. 
perl koha_perl_deps.pl -u
Uninstall these modules and then install them via CPAN.
perl koha_perl_deps.pl -u | grep 'No' | sed -e 's/::/-/g' | awk '{print "yum -y erase perl-"$1}' > perl-pkgs-install-sil
sh perl-pkgs-install-sil
Install modules from CPAN which you uninstalled,
perl koha_perl_deps.pl -m | grep 'No' | awk '{print "cpan -i "$1}' > perl-modules-install-nr
sh perl-modules-install-nr
== Mysql server settings ==
You may set up mysqld to start automatically on every boot.
chkconfig mysqld on
Make changes below at /etc/my.cnf file. Restart mysql server.
vim /etc/my.cnf
[mysqld]
character-set-server=utf8
skip-character-set-client-handshake
service mysqld restart
Run command below for mysql server security configuration.
/usr/bin/mysql_safe_installation
Generate KOHA database. Set a password for kohaadmin user. In the example below, the password has been set as ‘kohasecret’.
mysqladmin -u root -p create koha
mysql -u root -p
grant all privileges on koha.* to kohaadmin@localhost identified by 'kohasecret';
flush privileges;
== KOHA installation: ==
Go to Koha installation directory. Run commands below.
groupadd koha
useradd -s /bin/false -d /usr/share/koha -g koha -M koha
perl Makefile.PL
At this stage (while Makefile.PL script is running), some of questions will be asked. There are adequate explanations in the script. The server should have registered DNS name. Otherwise the script fails. When the script finishes successfully, Makefile file will have been generated. When you want to change any settings related to the script, rerun it. When you have finished with it, install koha files into the system by running following commands.
make
make install
To run a script from shell related to koha, define shell variables. 
vim /etc/profile.d/koha.tcsh
setenv KOHA_CONF /etc/koha/koha-conf.xml
setenv PERL5LIB /usr/share/koha/lib
vim /etc/profile.d/koha.sh
export KOHA_CONF=/etc/koha/koha-conf.xml
export PERL5LIB=/usr/share/koha/lib
== Koha zebra index configuration ==
1. Installation of koha index daemon
It is necessary to install koha-index-daemon program in order to update zebra indexes according to Koha catalog records changes. Koha comes with zebraqueue_daemon.pl script. This script has some problems. It is better to use Tamil index program. Install it from CPAN;
 cpan -i Koha::Contrib::Tamil
2. Zebra configuration
Package installation has been described above. The path that zebra modules have been installed displayed incorrectly in Zebra setting files in 64 bit systems. These files are zebra-authorities.cfg, zebra-authorities-dom.cfg, zebra-biblios.cfg, zebra-biblios-dom.cfg files. They are found in /etc/koha/zebradb/ in Centos Koha installation. Open these files
vim /etc/koha/zebradb/zebra-*.cfg
and then change line 
modulePath: /usr/lib/idzebra-2.0/modules
as below.
modulePath: /usr/lib64/idzebra-2.0/modules
Otherwise, zebra modules cannot be started in 64 bit systems.
We installed zebra 2.0 series software. In version 2.0 zebraidx binary is named as zebraidx-2.0. And in some koha scripts zebra binary is reffered as zebraidx. So ‘zebraidx-2.0’ file should be linked as ‘zebraidx’,
ln -s /usr/bin/zebraidx-2.0 /usr/bin/zebraidx
(This step may be unnecessary with newer packages: idzebra-2.0.58-6.fc23.x86_64 creates the symlink upon installation.)
If you selected GRS1 as record filter in koha installation you should make modification in word-phrase-utf.chr file for Zebra to search “İ” and “ı” Turkish letters correctly. Add lines below to word-phrase-utf.chr file.
vim /etc/koha/zebradb/etc/word-phrase-utf.chr
Add
map İ	i
map ı	i
lines. If you use ICU, you should modify etc/koha/zebradb/etc/words-icu.xml file. Find
<transliterate rule="\'>\ "/> 
line and add
<transliterate rule="ı>I"/> 
line below.
In order to run zebra services at system startup add lines below to “/etc/rc.local” file,
export KOHA_CONF=/etc/koha/koha-conf.xml
export PERL5LIB=/usr/share/koha/lib
/usr/bin/zebrasrv-2.0 -D -T -p /var/run/zebrasrv.pid -f /etc/koha/koha-conf.xml -l /var/log/koha/zebrasrv.log
/usr/local/bin/koha-index-daemon --timeout 10 --directory /tmp &
== HTTPD Configuration ==
Make symbolic link to koha web server configuration file from apache server configuration directory.
ln -s /etc/koha/koha-httpd.conf /etc/httpd/conf.d/ 
vim /etc/httpd/conf/httpd.conf 
Listen 8008
Define your web server ports for Koha opac and staff interfaces. A sample setting is given below. You can customize web configuration for your needs. 
vim /etc/httpd/conf.d/koha-httpd.conf
<VirtualHost *:80>
<VirtualHost *:8008>
Timeout 3600
== Iptables rules ==
Give necessary permissions from your firewall to web, zebra etc. services. In our example we are using ports 80,443 and 8008 for web, 9998 for zebra and z39.50, 5500 for oclc gateway. Insert following rules (to the top of INPUT rules) to /etc/sysconfig/iptables file) and restart iptables service.
vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp -s 192.168.71.146 --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5500 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8008 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9998 -j ACCEPT
/etc/init.d/iptables restart
== Turkish Translation ==
İssue commands below to install Turkish translations files to the system. For languages other than Turkish, change tr-TR code with appropriate language code.
cd /usr/share/koha/misc/translator/
perl translate install tr-TR
== Web Installation ==
From your browser (on the server of installed KOHA), open http://localhost:8008/ address from a browser. Make necessary settings from administrator interface. 
== Generating Zebra indexes ==
Stop any running zebra programs. Generate Zebra indexes by issuing commands below,
cd /usr/share/koha/bin/migration_tools/
./rebuild_zebra.pl -b -a -r -v
Rerun Zebra services,
. /etc/rc.local
== Cron Settings ==
Create a file named as koha for basic cron services in /etc/cron.d/ directory
vim /etc/cron.d/koha
File content will be as follows,
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
PERL5LIB="/usr/share/koha/lib"
KOHA_CONF="/etc/koha/koha-conf.xml"
# ADVANCE NOTICES. Every day at 05:49 am.
49 5 * * * root perl /usr/share/koha/bin/cronjobs/advance_notices.pl -c
# OVERDUE NOTICES. Everyday at 05:45 am.
45 5 * * * root perl /usr/share/koha/bin/cronjobs/overdue_notices.pl -t
# SEND EMAILS. Everyday at 06:30 am.
30 6 * * * root perl /usr/share/koha/bin/cronjobs/process_message_queue.pl
# FINES. Everyday from 07:00 am to 23:00 pm
0 7-23/2 * * * root perl /usr/share/koha/bin/cronjobs/fines.pl
Make cron service reread its settings.
 service crond reload
== See also ==
* Koha 3.22 on Fedora 23
Category:Installation
Category:Installation_alternatives