GCP | KOHA Library System


Koha Cloud Installation

Koha – Library Catalog Software Google Cloud Platform | VM Hosted

In our current environment, budgets are constantly being slashed, systems demands are increasing, and vendors are constantly adding unnecessary features to justify their cost. Okay, so maybe they add features which costs more to host. Either-way, we don’t want them! Koha was a proposed project by our Director of Libraries. An Open-Source platform, self-hosted (yay, me!), and a strong community supporting the application. Did I mention that it’s free? I chose to launch on Google Cloud Platform (GCP) because I’m most comfortable with their platform. After all, I am Google Cloud certified

Installation steps: VM InstallationOn GCP:  https://console.cloud.google.com/

  • From your newly created project, navigate to ‘Compute Engine’ > ‘VM Instances’
  • Select ‘Create’ to create a new VM instance.
  • Using a general purpose N1-standard-1 instance should be plenty to start you out. This may even be enough for the production load – for us, it is.
    • This instance will have 1 vCPU and 3.75GB Memory
  • Select a Debian boot disk
  • Allow HTTP/S traffic. HTTP can be disabled in the future after you install the SSL certificate and redirects to HTTPS.

Koha Installation This is a brief version of what I ended up using, but for full documentation, please refer to:  https://wiki.koha-community.org/wiki/Debian My documentation may not be maintained with the most current version(s).

  1. Add GPG key to your debian server (validates security)

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

  1. Install the current Stable version of Koha

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

  1. Run updates

$ sudo apt-get update

  1. Install your chosen Koha version (v20.05)

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

  1. Update the package

$ sudo apt-get update

  1. Install Koha

$ sudo apt-get install koha-common

  1. Install the database (MariaDB)

$ sudo apt-get install mariadb-server

  1. Configuring defaults

$ sudo nano /etc/koha/koha-sites.conf## set the domain value for your installation. Additional documentation can be found here: https://wiki.koha-community.org/wiki/How_to_set_up_a_domain_name_for_Koha ## set the intrasuffix for DNS

  1. Set up Apache

$ sudo a2enmod rewrite$ sudo a2enmod cgi$ sudo service apache2 restart

  1. If you’re using IP rather than DNS entries to communicate with the server, you will need to adjust the following file with this:

$ sudo nano /etc/apache2/ports.conf## add the option to listen on 80 && 8080Listen 80Listen 8080

  1. Set up Plack

$ sudo koha-plack –enable libraryname$ sudo koha-plack –start libraryname$ sudo service restart apache2## you can change libraryname to anything you wish. I chose something that was directly related to my instance- ‘library‘. lol

  1. DNS configuration
    1. Navigate to your DNS provider and configure a subdomain (library.domain.com) to point to your newly hosted server IP address (xx.xx.xx.xx) with an A record.
    2. Save your A record & test navigation to your new subdomain with HTTP!
  2. You may need to configure your installation hostname if you changed ‘libraryname’.

$ sudo nano /etc/koha/koha-sites.conf## verify your domain name and site name (hostname).

  1. The first time you navigate to your DNS name (Koha instance), you will need a password that is pre-defined.

$ sudo koha-passwd libraryname## remember, you changed libraryname earlier – change it here too..

  1. You’re set to login, change the administrative account, create additional accounts and start importing your catalog for usage!!

[Optional I]If you’re a security guy, you’re going to want to install an SSl certificate  [Optional II]If you’re a systems guy that doesn’t believe that the cloud is magical and automatically equates to a backup, you’re going to want to keep reading as well to see the backup procedures  [Optional III]Scaling, elasticity? Well, I don’t have a job with AWS or GCP just yet. Those configurations are why those guys get paid the big bucks. I’ll update this when I get there. It’ll likely include an Ansible playbook, propagated through Jenkins pipeline, and load-balanced across several regions  [Optional I] SSL Installation$ sudo apt-get install certbot python-certbot-apache$ sudo certbot –apache or $ sudo certbot certonly –apache$ sudo certbot renew –dry-run ## test automatic renewal Test that your SSL is now accepting HTTPS by navigating to your domain with the HTTPS://library.domain.com header. OR, head over to this site:  https://www.ssllabs.com/ssltest/[Optional II]Backups & Snapshots

  1. Configure snapshots in Google Cloud Platform on a SCHEDULE!!!
  2. From within your Debian server, you can also create backups. You can do some research on Debian package specific backup commands.
  3. You may also be interested in using the Mariadb-backup Package. https://packages.debian.org/sid/mariadb-backup

[Optional III]Scaling & Elasticity Like I said before. Once I land the big job- I’ll be back to update this  Edited: 6/27/2020 by Gary Innerarity

Tags ,

How can we help?