Koha Installation on Ubuntu Desktop
sudo -s
Update your system,
sudo apt-get update
Creating Koha system user
Open a Command Terminal and type following commands,
groupadd koha
useradd -g koha koha
sudo mkdir /build
sudo chmod -R 777 /build
Download Koha-3.02.05 package from www.koha-community.org
Extract the package by right click and select "Extract to".
Copy Koha package to the folder /build
mv koha-3.02.05.tar.gz /build
cd /build
tar -zxvf koha-3.02.05.tar.gz
cd koha-3.2.5/
Installation of dependencies
sudo apt-get install zip unzip lamp-server^ yaz idzebra-2.0 dselect
cd /build/koha-3.2.5
sudo dpkg --set-selections <install_misc/ubuntu.packages
sudo dselect
Installation of Perl dependencies
apt-get install libmarc-crosswalk-dublincore-perl libhtml-scrubber-perl libalgorithm-checkdigits-perl libbiblio-endnotestyle-perl
apt-get install libemail-date-perl libyaml-perl libjson-any-perl libxml-writer-perl libxml-sax-writer-perl
We have to install certain dependecies using CPAN,
sudo cpan
Accept all default settings.
Enter the following command in the CPAN prompt,
install HTTP:OAI IPC::Cmd Text::CSV::Encoded
quit
Configuration of UTF-8 in MySQL and Apache
Enable UTF-8 at MySQL
Open a Terminal and type following command,
sudo gedit /etc/mysql/my.cnf
[Under the Basic settings section, add the following,]
# UTF-8 Defaults for Koha
init-connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_general_ci
Save the file and close the editor.
UTF-8 encoding in Apache
Open a terminal and type the following command,
gedit /etc/apache2/conf.d/charset
[Add the following two lines in]
AddCharset UTF-8 .utf8
AddDefaultCharset UTF-8
Save the file and close the editor.
Enter following command to set locale on Ubuntu
sudo update-locale LANG=en_IN.UTF-8
Creation of MySQL Database for KOHA
Open a terminal and login as root and enter following commands,
mysql -u root -p
[enter mysql root password here]
Then type,
create database koha;
grant all privileges on koha.* to 'kohaadmin'@'localhost' identified by 'katikoan';
flush privileges;
quit;
Test to make sure the SAX Parser is setup correctly
cd koha-3.2.5
sudo gedit /etc/perl/XML/SAX/ParserDetails.ini
Move these two lines to the end of the file:
[XML::LibXML::SAX:Parser]
http://xml.org/sax/features/namespaces=1
Run the command again,
misc/sax_parser_print.pl
Setting environment variables
gedit /etc/bash.bashrc.local
Add the following lines there,
export KOHA_CONF=/etc/koha/koha-conf.xml
export PERL5LIB=/usr/share/koha/lib
Save and close the file.
Koha Installation
Now KOHA can be installed by following commands:
Enter into Koha folder
cd /build/koha-3.2.5
perl Makefile.PL
Answer all questions without any change. Default values are accepted for us.
Type the following commands,
make
make test
sudo make install
Add the following lines to /etc/apache2/ports.conf, just below the following line Listen 80
Open a Command Terminal and type following commands
sudo gedit /etc/apache2/ports.conf
Listen 80
Listen 8080
save the file and close.
Open a terminal and login as root
sudo su
ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha
sudo a2enmod rewrite
sudo a2ensite koha
/etc/init.d/apache2 restart
Zebra configuration
Open a terminal and login as root
sudo ln -s /usr/share/koha/bin/koha-zebra-ctl.sh /etc/init.d/koha-zebra-daemon
sudo update-rc.d koha-zebra-daemon defaults
sudo ln -s /usr/share/koha/bin/koha-zebraqueue-ctl.sh /etc/init.d/koha-zebraqueue-daemon
sudo update-rc.d koha-zebraqueue-daemon defaults
Edit the following files,
sudo gedit /usr/share/koha/bin/koha-zebra-ctl.sh
sudo gedit /usr/share/koha/bin/koha-zebraqueue-ctl.sh
Change USER and GROUP to root. Result is,
#!/bin/bash
USER=root
GROUP=root
Set following folders ownership to Koha user
sudo chmod -R 777 /var/lock/koha
sudo chown -R koha:koha /var/lock/koha
sudo chmod -R 777 /var/lib/koha/
sudo chown -R koha:koha /var/lib/koha
Cronjob Settings
sudo su
cd /usr/share/koha/bin/cronjobs
crontab -u root crontab.example
crontab -u username crontab.example [Username denotes name of your home user]
crontab -e
Check the locations in following lines ,
#Environment
PERL5LIB=/usr/share/koha/lib
KOHA_CONF=/etc/koha/koha-conf.xml
#Some additional variables
KOHA_CRON_PATH=/usr/share/koha/bin/cronjobs
Save the file by pressing ctrl+o buttons
Press enter
Quit the editor by pressing ctrl+X buttons
Some settings for Apaache,
sudo gedit /etc/koha/koha-httpd.conf
check the following line,
## OPAC
<VirtualHost 127.0.1.1:80> or Local IP:80
Change the port number
## OPAC
<VirtualHost *:80>
Find this line too,
## Intranet
<VirtualHost 127.0.1.1:8080> or Local IP:8080
Change to
## Intranet
<VirtualHost *:8080>
Add the following line at the end of the file,
ServerName localhost
Remove the Default site file in site-enable, apache 2 directory
sudo rm /etc/apache2/sites-enabled/000-default
Restart the Apaches server,
sudo /etc/init.d/apache2 restart
Run the Web installer
http://127.0.0.1:8080 or localhost:8080 or local IP :8080
URL of OPAC is http://127.0.0.1:80 or http://localhost or http://your local IP
Zebra Management
Starting Zebra Server
Open a terminal and type following commands,
sudo su
sudo /etc/init.d/koha-zebra-daemon start
sudo /etc/init.d/koha-zebraqueue-daemon start
Rebuilding Zebra Index
sudo KOHA_CONF=/etc/koha/koha-conf.xml PERL5LIB=/usr/share/koha/lib /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -b -r -v
Quick Indexing
sudo KOHA_CONF=/etc/koha/koha-conf.xml PERL5LIB=/usr/share/koha/lib /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -b -w
Upgrade koha 3.4.0 to 3.4.1
/koha_perl_deps.pl -u -m #
locate koha-install-log
perl Makefile.PL --prev-install-log /usr/share/koha/misc/koha-install-log
make
make test
make upgrade
sudo gedit /etc/koha/koha-conf.xml
Koha 3.4.x or later no longer stores items in biblio records so if you are upgrading from an older version as part of the upgrade you will need to do the following two steps, they can take a long time (several hours) to complete for large databases
misc/maintenance/remove_items_from_biblioitems.pl --run
misc/migration_tools/rebuild_zebra.pl -b -r
You can truncate session table before doing a backup command (mysqldump)
mysql -u<kohauser -p<password <koha-db-name -e 'TRUNCATE TABLE sessions'