Pre-requisites

Add the Koha community repository to your sources

echo deb http://debian.koha-community.org/koha stable main | sudo tee /etc/apt/sources.list.d/koha.list

Add Koha GPG Key

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

Update and Upgrade Applications on your server

sudo apt install update

sudo apt install upgrade

sudo apt clean

Install the latest Koha Release

sudo apt install koha-common

Configure the Server

sudo nano –B /etc/koha/koha-sites.conf

(The –B option is for backing up – a backup file of the previous configuration is created every time you save. The backup file will have “ ~ ” appended to it – it’s useful if you need to revert to the original settings)

The actual settings in your configuration file will depend on your server set up (whether you are using an IP based installed or actual domain names etc.). If you are doing an IP-based installation, change the line

INTRAPORT="80"              

To

INTRAPORT="8080"              

The file should look like this:

# Apache virtual hosts creation variables

DOMAIN=".myDNSname.org"

INTRAPORT="8080"               # use 8080 for an IP-based install.

INTRAPREFIX=""

INTRASUFFIX="-intra"

OPACPORT="80"

OPACPREFIX=""

OPACSUFFIX=""

# SQL file to load into new instances

DEFAULTSQL=""

# Zebra global configuration variables

ZEBRA_MARC_FORMAT="marc21"   # or normarc or unimarc.

ZEBRA_LANGUAGE="en"          # match with installation language (e.g. es for Spanish)

BIBLIOS_INDEXING_MODE="dom"

AUTHORITIES_INDEXING_MODE="dom"

 

# Memcached global configuration variables

USE_MEMCACHED="no"

MEMCACHED_SERVERS="127.0.0.1:11211"

MEMCACHED_PREFIX="koha_"

Install Apache

sudo apt install apache2

Install MySQL + Ubuntu 16 Workaround

sudo apt install mysql-server

Koha is not yet fully compatible with Ubuntu 16, so you need to bypass the problem by doing editing the mysqld.conf file as follows:

sudo nano –B /etc/mysql/mysql.conf.d/mysqld.conf

Insert the following in the section [mysqld]

sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Secure MySQL

MySQL comes with some security risks – remote login,  anonymous user and test database. Type the following to secure it:

sudo mysql_secure_installation

Answer “n” (no – case sensitive) to the first question and “Y” (yes) to the rest

Enable the Apache mod_rewrite modules

sudo a2enmod rewrite

sudo a2enmod cgi

sudo service apache2 restart

Create the Library Instance

sudo koha-create --create-db library

“library” can be anything you want (make it short, simple and sensible though). This will be the name of your Koha library instance

Configure Apache

I’m assuming you want an IP-based install such that you will access your OPAC on <ipaddress>:<port#> and Staff page on <ipaddress>:<port#>. If so, configure Apache to listen to the ports (don’t delete any lines that already exist):

sudo nano –B /etc/apache2/ports.conf

Add the following lines underneath “Listen 80”:

Listen <opac-port#>=

Listen <staff-port#>

So if you want your OPAC port to be 7777 and your staff page port to be 7778, enter the following beneath “Listen 80”:

Listen 7777

Listen 7778

Setup Your Library Instance’s Apache Configuration

sudo nano –B /etc/apache2/sites-enabled/library.conf

where library corresponds with the name of the library instance you created above

Enable Modules and Site

sudo a2enmod deflate

sudo a2ensite library

sudo service apache2 restart

Web Installation

The rest of the installation will be completed on the staff page via a web-browser.

Open a web-browser on another computer (if you installed it on the server version, or on the local browser if you are using a desktop version) and go to the address <ipaddress>:<staff-port#>. If you the IP address of your Koha server is 192.168.1.4 and your staff page port number is 7778, enter this

192.168.1.4:7778

You will be asked for a username and password. Your password will be koha_library, where library is the name of the library instance which you created earlier.

To find the username, go back to the terminal on your Koha server and enter the following command and copy the password (make sure you change library to the name of your Koha instance:

sudo xmlstarlet sel -t -v 'yazgfs/config/pass' /etc/koha/sites/library/koha-conf.xml

Complete the web install, after which you will be redirected to the staff login page.

Create A New Library

Go to Home > Administration > Libraries and Group > New Library

Create A Staff Patron With Super-User Permissions

Go to Home > Patrons > New Patron > Staff

After creating the patron,

Click on More > Set Permissions > Select “Super-librarian” > Save

Log out, then log in with the user which you just created. Enjoy!