Install Koha on Debian 9 (Stretch)

1 – edit the source list

 nano /etc/apt/sources.list

add this

deb http://ftp.us.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stretch main contrib non-free

 

2- Update the repository,

apt-get update

3- Install sudo 

apt-get install sudo

4- system Update  

sudo apt-get update
sudo apt-get upgrade

5-  optionally  install Leafpad 

apt-get install leafpad

6- Add Koha community repository

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

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

Update the software repository

sudo apt-get update

7- Install Koha

The following command will install latest release of Koha.

sudo apt-get install koha-common

8- Server configuration

In this step, need to edit network information like domain name and port numbers.
sudo leafpad /etc/koha/koha-sites.conf
Here I change port number of Koha staff client to 8080. Find the following line in the file and make changes.
INTRAPORT=”8080″

9 -Install MySQL server

Apply the following command to install MySQL server.
sudo apt-get install mariadb-server
OR
apt-get install mysql-server

Assign Root password for MySQL

Apply following commands one by one,
sudo su
mysqladmin -u root password newpass [Replace ‘newpass‘]
exit

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

We have assigned 8080 port for the Koha staff client and 80 for OPAC.
Open following file and add 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

sudo a2dissite 000-default
sudo a2enmod deflate
sudo a2ensite library
sudo service apache2 restart

Now access Koha  through
http://127.0.1.1:8080 (Stff client)
http://127.0.1.1:80 (Online catalogue)