LINUX, FOSS AND LIBRARY TECHNOLOGY ENTHUSIAST

Thursday, May 7, 2020

Install Koha on Debian

1 comments

Koha officially supports Debian GNU/Linux. Download ISO file of the stable version of Debian GNU/Linux from here and proceed with installation via LAN ( with internet connectivity) during the installation you can choose your favorite desktop environment, I do personally recommend XFCE for the fast performance.

Install Debian Operating System 

If you are not familiar with Debian installation, I do recommend this video 

Open Applications > System Tools > Terminal and execute the below commands one by one. NB: If you are not familiar with the VIM editor better use gedit/mousepad/leafpad.

Update Debian using apt

sudo apt update && sudo apt upgrade -y

Install LAMP stack and a few required packages not available with Debian by default. 
 
sudo apt install -y software-properties-common dirmngr file-roller unzip wget gnupg2 git curl vim tmux apache2 mariadb-server php libapache2-mod-php php-{bcmath,bz2,intl,gd,mbstring,mysql,zip,cli,fpm,opcache,xml,curl,intl,xsl,soap,json,apcu,imap,xmlrpc}

Clear the apt-get packager manager cache

sudo apt clean

Securing MariaDB

Run this command to improve the security of the MariaDB installation:

sudo mysql_secure_installation

(The script will prompt you to set up the root user password, remove the anonymous user, restrict root user access to the local machine and remove the test database. In the end, the script will reload the privilege tables ensuring that all changes take effect immediately. All steps are explained in detail and it is recommended to answer “Y” (yes) to all questions.)

Add Koha community repository (If you want stable/latest version of koha change oldstable to stable)

sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/koha-keyring.gpg] https://debian.koha-community.org/koha oldstable main" >> /etc/apt/sources.list.d/koha.list'

Add trusted repository key

sudo sh -c 'wget -qO - https://debian.koha-community.org/koha/gpg.asc | gpg --dearmor -o /usr/share/keyrings/koha-keyring.gpg'

Update software repository

sudo apt update

Install Koha and dependencies

sudo apt install -y koha-common

(takes 5 mins on a reasonably fast internet connection)

Edit initial config file

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

Edit INTRAPORT as 8080, OPACPORT as 80, domain, and Memcached [for database, makes Koha faster] settings depending on install

Ensure rewrite and cgi are enabled

sudo a2enmod rewrite cgi

Restart Apache to take effect

sudo systemctl restart apache2

Setup the database for Koha

sudo koha-create --create-db library

Add new 8080 port (for IP based install) to Apache

sudo vim /etc/apache2/ports.conf

(need to add Listen 8080 below Listen 80)

Enable Virtual-host on Apache

sudo a2dissite 000-default && sudo a2enmod deflate && sudo a2ensite library && sudo systemctl restart apache2


Test to ensure everything is working

In the web browser, visit http://127.0.0.1 {Koha maintenance message} and visit http://127.0.0.1:8080 It will prompt for username & password

username --> koha_library
password --> get it executing this command –>

sudo koha-passwd library

Follow onscreen instructions/wizard create a library and a super librarian

Change Koha Master Password (optional)


Koha master password can be changed by editing the koha-conf.xml file

(for single click changing password, use this command)

sudo sed -i 's/1MvFLNny4naCWmo@/kohalib/g' /etc/koha/sites/library/koha-conf.xml

OR

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

Under config, section find out the line password and change it

<config>
 <db_scheme>mysql</db_scheme>
 <database>koha_library</database>
 <hostname>localhost</hostname>
 <port>3306</port>
 <user>koha_library</user>
 <pass>1MvFLNny4naCWmo@</pass>

(change default password 1MvFLNny4naCWmo@ to kohalib) save it

Change MariaDB privileges

sudo mariadb -uroot -p

[enter the MariaDB Root password]

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


Restart Memcached Apache2 and MariaDB

sudo systemctl restart memcached apache2 mysql


Enable Plack with Koha and Improve the Performance 

sudo a2enmod headers proxy_http && sudo systemctl restart apache2 && sudo koha-plack --enable library && sudo koha-plack --start  library

1 comment:

  1. Dude/Dudette... THANK YOU. This is straight forward, easy and almost flawless (I'm not the best with linux so the mistakes are my fat fingers). Overall incredibly helpful, we are planning on testing some SIP connections and build a simple ILS, thank you again for the great step by step

    ReplyDelete