Sei sulla pagina 1di 5

Steps for Installation of KOHA on Ubuntu 16.

04
Prepared by
Dr S S Kushwah,
Dy. Librarian,
National Law Institute University, Bhopal
shivpal_s@yahoo.com

Contents
Installation & Update of Operating System Ubuntu 16.04..................................................................1
Koha Installation..................................................................................................................................1
Install Koha..........................................................................................................................................2
Server Configuration............................................................................................................................2
MySQL Maria DB Installation.............................................................................................................2
Install MariaDB server.................................................................................................................2
Assign Root password for MySQL..............................................................................................3
Koha Instance Creation........................................................................................................................3
Add New Port in Apachi2....................................................................................................................3
Restart Apache,.....................................................................................................................................3
Change KOHA PAssword....................................................................................................................3
Backup Restore.....................................................................................................................................4

Installation & Update of Operating System Ubuntu 16.04

Install default Ubuntu 16.04 LTS & Update the system using following commands

sudo apt-get update


sudo apt-get upgrade

Install lightweight text editor for editing files

sudo apt-get install leafpad

Koha Installation
Add Koha community repository

echo deb http://debian.koha-community.org/koha stable main | sudo tee


/etc/apt/sources.list.d/koha.list

or

echo 'deb http://debian.koha-community.org/koha 17.11 main' | sudo tee


/etc/apt/sources.list.d/koha.list

Add the GPG key to your system so that you know that the packages haven't been tampered with:

wget -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -


sudo apt-get update

Install Koha
Following command will install latest release of Koha.

sudo apt-get install koha-common

The command will start to download Koha and required packages, during the process it will ask to
enter mail of system you may accept the default values.

If you come across following error message

Errors were encountered while processing:


libapache2-mpm-itk
apache2-mpm-itk
koha-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

The above errors are related with apache2-mpm-itk issue. Apply following commands. If you have
not found error related to apache2-mpm-itk, skip following section. Apply following commands in
a terminal (if above errors appear)

sudo a2dismod mpm_event


sudo a2enmod mpm_prefork
sudo service apache2 restart
sudo apt-get install -f

Server Configuration
In this step, need to edit network information like domain name and port numbers.

sudo leafpad /etc/koha/koha-sites.conf

Find following line in the file and make changes, here I have changed port number of Koha Staff
Client to 8080.

INTRAPORT="8080"

MySQL Maria DB Installation

Install MariaDB server


Here we use MariaDB server instead of MySQL server. Apply the following command to install
MariaDB server.

sudo apt-get install mariadb-server


Assign Root password for MySQL
Apply following command,

sudo mysqladmin -u root password newpass [Replace 'newpass']

Koha Instance Creation


Apply following commands to create Apache configuration files.

sudo a2enmod rewrite


sudo a2enmod cgi
sudo service apache2 restart

Create a Koha instance with the name library.

sudo koha-create --create-db library

Add New Port in Apachi2


We have assigned 8080 port for the Koha staff client and 80 for OPAC.
Open the following file and add a new port.

sudo leafpad /etc/apache2/ports.conf

Copy paste following line below Listen 80

Listen 8080

Restart Apache,
sudo service apache2 restart

Enable modules and sites

Now enable the apache modules this config needs, enable koha's configuration, and restart apache.

sudo a2dissite 000-default


sudo a2enmod deflate
sudo a2ensite library
sudo service apache2 restart

Open following links,

http://127.0.1.1:8080 (Staff client)


http://127.0.1.1:80 (Online catalogue)

Change KOHA PAssword

Koha master login username and password is same as MySQL database (e.g. koha_library), where
data stored. First change the password of koha_library database. Then put new password in
/etc/koha/sites/library/koha-conf.xml. Apply following commands in Applications > Accessories >
Terminal

sudo su

[enter the Linux Root password]

mysql -uroot -p

[enter the MySQL Root password]

use mysql;
SET PASSWORD FOR 'koha_library'@'localhost' = PASSWORD('koha123');
flush privileges;
quit;

Need to change new password in Koha configuration file.

Open the configuration file using any text editor. Use any text editor, gedit/leafpad. Leafpad is not
available, install;

sudo leafpad /etc/koha/sites/library/koha-conf.xml

The file will open. Scroll to bottom part of the file and find the line for password.

You can find old password. Place your new password.

Backup Restore

Backup of old Koha


Take backup of your existing Koha database. Either you can make use a database kept in
your pen drive otherwise you can apply following command to take backup,
mysqldump -u root -p koha_library >
/home/library/Desktop/koha_library.sql

Put MySQL root password, when it ask.

Install Koha

Restoration of old Koha database to new one, first remove existing database in new
installation.

sudo su
mysql -uroot -p

[Enter the MySQL Root password]

drop database koha_library;


create database koha_library;
quit;

Copy your database backup from your pen drive to home folder. Extract the backup file, the
extension will be .sql Then restore the old backup to new installation.

Database Restoration command,

mysql -uroot -p koha_library < /home/library/Desktop/koha_library.sql


[Check name of your source Koha database]
koha_library - name of database in new installation
koha.sql - name of database in old installation
Enter the MySQL root password.

Upgrade Database Schema


Database schema of old Koha should upgrade to new one, apply following commands in a
terminal.

sudo su
koha-upgrade-schema library

Rebuild the Zebra Index.

Apply following command in a terminal,

sudo koha-rebuild-zebra -v -f library

9617383851
shivpal_s@yahoo.com

Potrebbero piacerti anche