Showing posts with label Debian 9. Show all posts
Showing posts with label Debian 9. Show all posts

Install MariaDB 10.4 on Debian 9 (Stretch)

Image courtesy: mariadb.org
Debian 9 (Stretch) software repository contains MariaDB 10.1. Version 10.1 is a little bit old. It's possible to install the latest version of MariaDB (version 10.3 or 10.4) on Debian 9 to get good database performance. Latest versions of MariaDB free from the auto-increment bug. This version is free from Here is the method to install MariaDB 10.4 on Debian 9 when preparing system for Koha installation. This method can apply for a fresh installation of Koha. Don't try this method to install MariaDB on an existing installation of Koha.

Install dirmngr

sudo apt-get install software-properties-common dirmngr

Importing the MariaDB GPG Public Key and install MariaDB
Apply following commands,

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://espejito.fder.edu.uy/mariadb/repo/10.4/debian stretch main'

sudo apt update

sudo apt-get install mariadb-server

Assign Root password for MySQL
If password asks during the installation process, enter the password in the window. Apply following command, if the password window did not appear during the installation,

sudo mysqladmin -u root password newpass

[Replace 'newpass' with your own new MySQL Root password]

References
https://mariadb.com/kb/en/library/installing-mariadb-deb-files/#importing-the-mariadb-gpg-public-key

https://downloads.mariadb.org/mariadb/repositories/#distro=Debian&distro_release=stretch--stretch&mirror=rise&version=10.4

Install Koha on Debian

Install Debian Linux

Koha officially supports Debian Linux. Download the Debian 12 (Bookworm) DVD ISo file from the following link,


Burn the Debian ISO image to a Pen Drive/CD/DVD. Insert the medium, change the boot option of the computer, and start the installation process for Debian. During installation, choose the desired desktop (e.g., XFCE, Cinnamon, GNOME). Visit the link to familiarise yourself with the Debian installation.

Write down the user names and passwords in a diary while installing.

Prepare the Debian sources list.

We need to add the Debian software repository to the sources.list file.

Open a command terminal,

Applications > System >  Terminal

Enter the following command to log in as the root user,

su  [Enter Root Password]

Open sources.list in mousepad (default text editor with Debian 12 XFCE) editor. If the Mousepad editor is not available, use the Nano editor.

mousepad /etc/apt/sources.list  

Step 1. Delete all entries in the file.

Step 2. Copy and paste the following lines into the file,

deb http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware #Added by software-properties
deb http://security.debian.org/ bookworm-security non-free contrib main non-free-firmware
deb-src http://security.debian.org/ bookworm-security non-free contrib main non-free-firmware #Added by software-properties
deb http://deb.debian.org/debian/ bookworm-updates non-free contrib main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm-updates non-free contrib main non-free-firmware #Added by software-properties
deb http://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware

Save and close the file.
Update the repository,

apt update
apt upgrade

Install sudo on Debian.

Sudo is a tool available default with Ubuntu, which allows users to execute administrative tasks (e.g. installation, removal etc). The Sudo tool gives the convenience of applying Ubuntu commands. You can enable sudo while installing Debian; please visit this page. Otherwise, enable sudo after the installation of Debian. To enable sudo after the installation of Debian, apply the following commands one by one,

apt install sudo

Add default user to sudo

adduser username sudo  [Replace username with yours]

Restart/Logout the computer to enable sudo.

Add Koha repository

Install a few required packages not available with Debian.

sudo apt install -y software-properties-common dirmngr file-roller wget gnupg2

Add Koha software channel into Debian. It will install the old stable version of Koha. We can define which version to install when adding the repository. Visit the Koha Wiki for details. 

Add the GPG key and the repository. Apply the following commands one by one,

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

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'

Update the repository details,

sudo apt update

Install Koha

The following command will install the latest release of Koha.

sudo apt install -y koha-common

Server configuration

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

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

Here I change the port number of the Koha staff client to 8080. Find the following line in the file and make changes.

INTRAPORT="8080"

Install MariaDB server


sudo apt install -y mariadb-server


Assign Root password for MariaDB

If a password asks during installation, enter the password in the window. Apply the following command if the password window did not appear during the installation,

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

Koha instance creation

Apply the 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 ports for the Koha staff client and 80 for OPAC. Open the following file and add the new port, 8080, to Apache.

sudo mousepad /etc/apache2/ports.conf

Copy-paste the 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

Setup the library

After the successful installation, you need to create initial parameters (e.g. branch, item type, superuser creation etc.) to start with Koha. We need to open the web interface of Koha and start the configuration of Koha.
Restart the Memcached service to open the Koha web installer.

sudo service memcached restart

Open the following link in the web browser to open the staff client of Koha and set up the library,

http://127.0.1.1:8080 

Enter into the Koha staff client using the Database username and password of koha_library. It can find from the file, /etc/koha/sites/library/koha-conf.xml. Apply the following file in a terminal.

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

Search (Ctrl+F) for the segment MySQL in the text editor. Note down the database username and password and log into the Koha web installer.

Change Koha's default master password (Optional)

The password for the Koha database name was created during the installation process. The user can change the Koha database password. See the following link,

Reference

Koha on Ubuntu - packages


Install MariaDB on Debian 10