Install SLiMS 9 Bulian di Debian 10 (Buster)

Install SLiMS 9 Bulian di Debian 10 (Buster)

SLiMS Library Management System (SLiMS) adalah free and open source software untuk memenuhi kebutuhan

otomatisasi perpustakaan (library automation) dengan fitur yang dapat dikatakan lengkap dan masih terus aktif dikembangkan. SLiMS dapat digunakan oleh perpustakaan yang memiliki banyak koleksi, anggota dan staf, di lingkungan jaringan, baik itu jaringan lokal (intranet) maupun internet.

Fitur SLiMS Secara Umum :

  • Online Public Access Catalog (OPAC) dengan pembuatan thumbnail yang digenerate-on-the-fly. Thumbnail berguna untuk menampilkan sampul buku;
  • Mode penelusuran tersedia untuk yang sederhana (Simple Search) dan tingkat lanjut (Advanced Search);
  • Detail record (cantuman) juga tersedia format XML (Extensible Markup Language) untuk kebutuhan web service;
  • Manajemen data bibliografi yang efisien meminimalisasi redundansi data;
  • Manajemen master file untuk data referensial seperti GMD (General Material Designation), Tipe Koleksi, Penerbit, Pengarang, Lokasi, Pemasok (agen), dan lain-lain;
  • Sirkulasi dengan fitur:
    • Transaksi peminjaman dan pengembalian;
    • Reservasi koleksi;
    • Aturan peminjaman yang fleksibel;
    • Informasi keterlambatan dan denda.
  • Manajemen keanggotaan;
  • Inventarisasi koleksi (stock taking);
  • Laporan dan Statistik;
  • Pengelolaan terbitan berkala;
  • Dukungan pengelolaan dokumen multimedia (audio dan video) serta dokumen dijital;
  • Menyediakan berbagai bahasa pengantar;
  • Dukungan lingkungan Union Catalog Service;
  • Penghitung pengunjung perpustakaan;
  • Member Area untuk melihat koleksi sedang dipinjam oleh anggota;
  • Modul sistem dengan fitur:
    • Konfigurasi sistem global;
    • Manajemen modul;
    • Manajemen pengguna;
    • Pengaturan hari libur;
    • Pembuatan barcode otomatis;
    • Utilitas untuk backup.

 

1. Sistem yang dibutuhkan

Sistem yang digunakan untuk menjalankan aplikasi SLiMS 9 Bulian pada tutorial ini adalah:

  • Debian 10 Buster
  • Slims 9 Bulian
  • Apache web server versi 2.4
  • Mariadb versi 10.9
  • PHP scripting language versi 8.0
  • PHP8.0-gd
  • PHP8.0-gettext
  • PHP8.0-mbstring
  • YAZ (opsional)
  • phpMyAdmin dan atau Adminer database management console (opsional)

 

2. Seting Hostname

# hostnamectl set-hostname slims9.smkn1klaten.sch.id
# nano /etc/hosts

    127.0.0.1       localhost
    192.168.16.150   slims9.smkn1klaten.sch.id      slims9
# reboot

 

3. Update sistem

Update dan upgrade sistem debian serta install dependensi yang dibutuhkan

# apt -y update 
# apt -y upgrade
# apt -y install build-essential
# apt -y install net-tools
# apt -y install dnsutils
# apt -y install iftop

 

4. Install MariaDB Database Server

# apt -y install curl software-properties-common gnupg2
# apt -y upgrade
# reboot
# curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
# bash mariadb_repo_setup --mariadb-server-version=10.9
    [info] Checking for script prerequisites.
    [info] MariaDB Server version 10.9 is valid
    [info] Repository file successfully written to /etc/apt/sources.list.d/mariadb.list
    [info] Adding trusted package signing keys...
    [info] Running apt-get update...
    [info] Done adding trusted package signing keys

# apt update
# apt -y install mariadb-server mariadb-client
# mariadb-secure-installation

    NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
          SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

    In order to log into MariaDB to secure it, we'll need the current
    password for the root user. If you've just installed MariaDB, and
    haven't set the root password yet, you should just press enter here.

    Enter current password for root (enter for none): [Tekan Enter]
    OK, successfully used password, moving on...

    Setting the root password or using the unix_socket ensures that nobody
    can log into the MariaDB root user without the proper authorisation.

    You already have your root account protected, so you can safely answer 'n'.

    Switch to unix_socket authentication [Y/n] y
    Enabled successfully!
    Reloading privilege tables..
     ... Success!


    You already have your root account protected, so you can safely answer 'n'.

    Change the root password? [Y/n] y
    New password:    [ketikan password user root phpmyadmin disini]
    Re-enter new password:    [ketik ulang password]
    Password updated successfully!
    Reloading privilege tables..
     ... Success!


    By default, a MariaDB installation has an anonymous user, allowing anyone
    to log into MariaDB without having to have a user account created for
    them.  This is intended only for testing, and to make the installation
    go a bit smoother.  You should remove them before moving into a
    production environment.

    Remove anonymous users? [Y/n] y
     ... Success!

    Normally, root should only be allowed to connect from 'localhost'.  This
    ensures that someone cannot guess at the root password from the network.

    Disallow root login remotely? [Y/n] y
     ... Success!

    By default, MariaDB comes with a database named 'test' that anyone can
    access.  This is also intended only for testing, and should be removed
    before moving into a production environment.

    Remove test database and access to it? [Y/n] y
     - Dropping test database...
     ... Success!
     - Removing privileges on test database...
     ... Success!

    Reloading the privilege tables will ensure that all changes made so far
    will take effect immediately.

    Reload privilege tables now? [Y/n] y
     ... Success!

    Cleaning up...

    All done!  If you've completed all of the above steps, your MariaDB
    installation should now be secure.

    Thanks for using MariaDB!

    

 

5. Install multiple PHP

Install dependensi software
Software yang akan di install disini tidak hanya untuk kebutuhan instalasi PHP saja, tetapi agar proses instalasi berjalan normal ada baiknya kita install semuanya

# apt -y install apt-transport-https lsb-release ca-certificates

 

Menambahkan Repository Sury
Repository yang menyediakan PHP di Debian adalah Sury. Ondřej Surý orang yang mengelola sury.org adalah maintener PHP di Debian, jadi kualitas yang ditawarkan sama dengan repository resmi Debian. Tambahkan repository Sury kedalam konfigurasi APT

# echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
	deb https://packages.sury.org/php/ buster main

 

Install GPG Key dari Sury

# curl -sSL -o /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

 

Lakukan update sekaligus upgrade agar repository dari sury dapat dikenali oleh apt

# apt -y update
# apt -y upgrade

 

Install PHP7.3 (PHP default Debian 10)

# apt -y install php php-cgi php-cli libapache2-mod-php php-bcmath php-fpm php-common php-curl php-gd php-intl php-mbstring php-gettext php-mysql php-opcache php-readline php-xml php-xsl php-zip php-bz2

 

Install PHP7.4

# apt install -y php7.4 php7.4-cgi php7.4-cli libapache2-mod-php7.4 php7.4-bcmath php7.4-fpm php7.4-common php7.4-curl php7.4-gd php7.4-intl php7.4-mbstring php7.4-gettext php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml php7.4-xsl php7.4-zip php7.4-bz2

 

Install PHP8.0

# apt install -y php8.0 php8.0-cgi php8.0-cli libapache2-mod-php8.0 php8.0-bcmath php8.0-fpm php8.0-common php8.0-curl php8.0-gd php8.0-intl php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-readline php8.0-xml php8.0-xsl php8.0-zip php8.0-bz2

 

Install PHP8.1

# apt install -y php8.1 php8.1-cgi php8.1-cli libapache2-mod-php8.1 php8.1-bcmath php8.1-fpm php8.1-common php8.1-curl php8.1-gd php8.1-intl php8.1-mbstring php8.1-mysql php8.1-opcache php8.1-readline php8.1-xml php8.1-xsl php8.1-zip php8.1-bz2

 

6. Install Apache dan PHPMyAdmin

Install Apache Web Server

# apt-get -y install wget apache2

 

Install dan Unduh phpMyAdmin versi terbaru

# DATA="$(wget https://www.phpmyadmin.net/home_page/version.txt -q -O-)"
# URL="$(echo $DATA | cut -d ' ' -f 3)"
# VERSION="$(echo $DATA | cut -d ' ' -f 1)"
# wget https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.gz

 

Ekstrak file yang telah diunduh:

# tar xvf phpMyAdmin-${VERSION}-all-languages.tar.gz

 

Pindahkan folder hasil ekstrak ke folder /usr/share/phpmyadmin.

# mv phpMyAdmin-*/ /usr/share/phpmyadmin

 

Buat direktori untuk file temp phpMyAdmin.

# mkdir -p /var/lib/phpmyadmin/tmp
# chown -R www-data:www-data /var/lib/phpmyadmin

 

Buat direktori untuk file konfigurasi phpMyAdmin seperti file .htpass

# mkdir /etc/phpmyadmin/

 

Buat file konfigurasi phpMyAdmin.

# cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php

 

Edit file /usr/share/phpmyadmin/config.inc.php dan atur frasa sandi rahasia:

# nano /usr/share/phpmyadmin/config.inc.php
    $cfg['blowfish_secret'] = 'H2OxcGXxflSd8JwrwVlh6KW6s2rER63i';
    $cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';

 

Buat file konfigurasi Apache phpMyAdmin:

# nano /etc/apache2/conf-enabled/phpmyadmin.conf

 

Dan paste kan script di bawah ini ke file phpmyadmin.conf

    Alias /phpmyadmin /usr/share/phpmyadmin
    
    <Directory /usr/share/phpmyadmin>
        Options SymLinksIfOwnerMatch
        DirectoryIndex index.php

        <IfModule mod_php5.c>
            <IfModule mod_mime.c>
                AddType application/x-httpd-php .php
            </IfModule>
            <FilesMatch ".+\.php$">
                SetHandler application/x-httpd-php
            </FilesMatch>

            php_value include_path .
            php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
            php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/
            php_admin_value mbstring.func_overload 0
        </IfModule>
        <IfModule mod_php.c>
            <IfModule mod_mime.c>
                AddType application/x-httpd-php .php
            </IfModule>
            <FilesMatch ".+\.php$">
                SetHandler application/x-httpd-php
            </FilesMatch>

            php_value include_path .
            php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
            php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/
            php_admin_value mbstring.func_overload 0
        </IfModule>

    </Directory>

    # Authorize for setup
    <Directory /usr/share/phpmyadmin/setup>
        <IfModule mod_authz_core.c>
            <IfModule mod_authn_file.c>
                AuthType Basic
                AuthName "phpMyAdmin Setup"
                AuthUserFile /etc/phpmyadmin/htpasswd.setup
            </IfModule>
            Require valid-user
        </IfModule>
    </Directory>

    # Disallow web access to directories that don't need it
    <Directory /usr/share/phpmyadmin/templates>
        Require all denied
    </Directory>
    <Directory /usr/share/phpmyadmin/libraries>
        Require all denied
    </Directory>
    <Directory /usr/share/phpmyadmin/setup/lib>
        Require all denied
    </Directory>

 

Anda dapat membatasi akses dari IP tertentu dengan menambahkan baris seperti di bawah ini:

Require ip 127.0.0.1 192.168.16.0/24

 

Restart apache web server

# systemctl restart apache2

 

Akses interface web phpMyAdmin di http://[ServerIP|Hostname]/phpmyadmin. Gunakan nama user dan kata sandi yang sudah di seting sebelumnya untuk masuk.

 

7. Switch versi PHP

Memeriksa versi PHP yang aktif

# php -v
    PHP 8.1.11 (cli) (built: Sep 29 2022 22:12:52) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.1.11, Copyright (c) Zend Technologies
        with Zend OPcache v8.1.11, Copyright (c), by Zend Technologies

 

Dari hasil perintah diatas, terlihat bahwa versi PHP yang tampil adalah yang versi paling tinggi yaitu PHP8.1 sedangkan untuk melihat PHP yang aktif kita bisa gunakan cara berikut ini :

# nano /var/www/html/info.php
        <?php
        phpinfo();

# chmod +x /var/www/html/info.php

 

Kemudian akses menggunakan browser dengan mengetikan alamat http://IP_server/info.php

Dari tampilan diatas terlihat bahwa yang aktif saat ini adalah PHP versi PHP7.3, lalu bagaimana caranya agar yang aktif adalah PHP versi PHP7.4 atau PHP8.0 atau yang paling baru yaitu PHP8.1 ? caranya adalah sebagai berikut :

 

Disable modul PHP7.3

# a2dismod php7.3
    Module php7.3 disabled.
    To activate the new configuration, you need to run:
      systemctl restart apache2

 

Enable modul PHP8.0

# a2enmod php8.0
    Considering dependency mpm_prefork for php8.0:
    Considering conflict mpm_event for mpm_prefork:
    Considering conflict mpm_worker for mpm_prefork:
    Module mpm_prefork already enabled
    Considering conflict php5 for php8.0:
    Enabling module php8.0.
    To activate the new configuration, you need to run:
      systemctl restart apache2

 

Restart service Apache

# systemctl restart apache2

 

Cek kembali PHP yang aktif

# php -v
    PHP 8.1.11 (cli) (built: Sep 29 2022 22:12:52) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.1.11, Copyright (c) Zend Technologies
        with Zend OPcache v8.1.11, Copyright (c), by Zend Technologies

 

versi PHP masih tetap PHP8.1, kemudian kita lihat info lengkapnya

Dari tampilan diatas terlihat bahwa yang aktif saat ini adalah PHP versi PHP8.0, Jika kita ingin ke versi 7.4 atau 8.1, tinggal jalankan lagi perintah seperti di atas.

 

8. Tuning PHP

Untuk kebutuhan Export dan Import database di PHPMyAdmin kita lakukan perbubahan pada beberapa parameter di file php.ini

# nano /etc/php/8.0/apache2/php.ini

 

Dan rubah beberapa parameter seperti berikut ini:

max_execution_time = 60
max_input_time = 180
memory_limit = 512M
post_max_size = 800M
upload_max_filesize = 800M
max_file_uploads = 200

 

Lakukan restart pada service Apache

# /etc/init.d/apache2 restart
[ ok ] Restarting apache2 (via systemctl): apache2.service.

 

9. Install Slims 9 Bulian

Install extension yang dibutuhkan

# apt install php-pear yaz libyaz5 libyaz-dev libnet-z3950-zoom-perl

 

Install library yaz

# pecl install yaz

 

Tambahkan extension=yaz.so di konfigurasi php.ini

# nano /etc/php/8.0/apache2/php.ini

 

Konfigurasi extension di php.ini

...
; 
extension=yaz.so
;extension=bz2
;extension=curl
... 

 

Restart apache2 service

# /etc/init.d/apache2 restart
[ ok ] Restarting apache2 (via systemctl): apache2.service.

 

Login ke mysql shell

# mysql -u root -p

    Enter password:  [ketik password user root mysql]

    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 342
    Server version: 10.5.17-MariaDB-1:10.5.17+maria~deb10 mariadb.org binary distribution

    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    MariaDB [(none)]>

 

Buat database slims dan usernya

MariaDB [(none)]> SET GLOBAL log_bin_trust_function_creators = 1;
Query OK, 0 rows affected (0.012 sec)

MariaDB [(none)]> CREATE DATABASE slims;
Query OK, 1 row affected (0.004 sec)

MariaDB [(none)]> CREATE USER 'slims'@'localhost' IDENTIFIED BY 'rahasia';
Query OK, 0 rows affected (0.042 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON slims.* TO 'slims'@'localhost';
Query OK, 0 rows affected (0.012 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.014 sec)

MariaDB [(none)]> exit;
Bye

 

Download SLiMS 9 Bulian dari github

# apt -y install git
# git clone https://github.com/slims/slims9_bulian
    Cloning into 'slims9_bulian'...
    remote: Enumerating objects: 21089, done.
    remote: Counting objects: 100% (3403/3403), done.
    remote: Compressing objects: 100% (417/417), done.
    remote: Total 21089 (delta 3080), reused 3124 (delta 2969), pack-reused 17686
    Receiving objects: 100% (21089/21089), 55.96 MiB | 342.00 KiB/s, done.
    Resolving deltas: 100% (12223/12223), done.
    Checking out files: 100% (3747/3747), done.

 

Pindahkan folder slims9_bulian ke folder /var/www/html

# mv slims9_bulian /var/www/html/

 

Seting hak akses dan kepimilakan pada folder slims9_bulian

# chmod 755 /var/www/html/slims9_bulian
# chown -R www-data:www-data /var/www/html/slims9_bulian/
# cd /var/www/html/slims9_bulian/
# chmod -R 777 config/ files/ images/ repository/

 

Directive dokumen root ke folder slims9_bulian

# nano /etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and por$
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header $
        # match this virtual host. For the default virtual host (this file) $
        # value is not decisive as it is used as a last resort host regardle$
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        # DocumentRoot /var/www/html
        
        DocumentRoot /var/www/html/slims9_bulian

        # Available loglevels: trace8, ..., trace1, debug, info, notice, war$
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example t$
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

 

Restart apache2 service

# /etc/init.d/apache2 restart
[ ok ] Restarting apache2 (via systemctl): apache2.service.

 

10. Pengujian

Akses interface web slims 9 di http://[ServerIP|Hostname]/.

Klik Get Started

 

Klik Next

 

Klik Install SLiMS

 

Isikan pada kotak isian :

DATABASE NAME : slims
DATABASE USERNAME : slims
DATABASE PASSWORD : rahasia

Kemudian klik Test Connection

 

Klik Connection OK. Next

 

Isikan pada kotak isian :

USERNAME : admin
PASSWORD : admin123
RETYPE PASSWORD : admin123

Kemudian klik Run The Instalation

 

Klik Go to My SLiMS

 

 

Untuk dapat masuk ke halaman Administrator
ketik http://192.168.16.150/index.php?p=login
Username : admin
Password : admin123
Klik tombol Login

 

 

11. Selesai

Semoga dapat membantu dan bermanfaat