38
SLiMS Technical Aspects Hendro Wicaksono SLiMS Lead Developer [email protected]/gmail.com. Twitter: @hendrowicaksono, Facebook: facebook.com/hendrowicaksono

Technical Aspects of SLiMS

Embed Size (px)

DESCRIPTION

Technical Aspects of SLiMS

Citation preview

Page 1: Technical Aspects of SLiMS

SLiMS Technical Aspects

Hendro WicaksonoSLiMS Lead Developer

[email protected]/gmail.com. Twitter: @hendrowicaksono,

Facebook: facebook.com/hendrowicaksono

Page 2: Technical Aspects of SLiMS

Internet(HTTP Protocol)

request response

request

response

Web Server

Create, read,update, delete http://slims.web.id

Page 3: Technical Aspects of SLiMS

Kenapa & MySQL ?

Portabilitas yang lebih baik.

Page 4: Technical Aspects of SLiMS

Terbukti berjalan baik pada ...

Page 5: Technical Aspects of SLiMS

SCM software

Source code management menggunakan GIT (http://git-scm.com/)

Page 6: Technical Aspects of SLiMS

Update Harian

Versi stabil terakhir:SliMS 3 stable 15 (Matoa)https://github.com/slims/s3st15_matoa

Development page: https://github.com/slims

Download paket tarball:http://slims.web.id/web/?q=node/1

Web: http://slims.web.id

Page 7: Technical Aspects of SLiMS

Dokumentasi Developer

Developer:https://github.com/slims/s3-devdocs

Page 8: Technical Aspects of SLiMS

Dokumentasi Pengguna

http://slims.web.id/download/docs/s3-doc-id.pdf

Documentation source code (daily updated):https://github.com/slims/s3-doc-id(latex/lyx format)

Page 9: Technical Aspects of SLiMS

SLiMS menyimpan data

Data bibliografi, pengguna, transaksi disimpan di database MySQL.

Cover data bibliografi, lampiran berkas (file attachment), cache (label, barcode, swf), Foto anggota, Back-up (sql), generated report, disimpan di filesystem.

Page 10: Technical Aspects of SLiMS

Strategi Back-up (1)

Export “sqldump” secara berkala. Jika di Linux, gunakan cron.

Page 11: Technical Aspects of SLiMS

Strategi Back-up (2)

Copy folder aplikasi SliMS secara berkala. Jika di Linux, gunakan cron.

Page 12: Technical Aspects of SLiMS

Contoh skrip untuk backup#!/bin/sh

# membersihkan folder backuprm -Rf /home/hendro/backup/*

# membuat subfolder sql utk menyimpan mkdir -p /home/hendro/backup/slims_backup/sqlmkdir -p /home/hendro/backup/slims_backup/app

# dumping sql data/usr/bin/mysqldump -u root --lock-tables --password='mysqlrootpasswd' slimsdb > /home/hendro/backup/slims_backup/sql/slims.sql

# copy app foldercp -R /var/www/libsenayan /home/hendro/backup/senayan_backup/app/

tar -czf /home/hendro/backup/`date +%Y_%m_%d-%d_%B_%Y-%H_%M`.tar.gz -C /home/hendro/backup/slims_backup

scp /home/hendro/backup/*.tar.gz [email protected]:/home/hendro/backup_senayan/ >/dev/null 2>&1exit

Page 13: Technical Aspects of SLiMS

Contoh Implementasi (1)

Perpustakaan Kemdiknas RI

ProductionServer

OPACLibrary

Staff

Backup/FileServer

request/response

request/response

backupfrequentlyvia cron &

ssh

InternetOPAC

update frequently via cron & ssh

Intranet / LAN Internet / DMZ

Untuk akses OPAC, diinstal SLiMS terpisah tetapi mengacu ke database yang sama dengan username database yang “almost read-only”.Untuk sinkronisasi folder 'images', files, repository antara aplikasi prod & opac, digunakan rsync via cron.

Server Internet OPAC tidak terkoneksi langsung dengan Production Server.Akses ke database MySQL di set “read-only” (GRANT SELECT ON dbname.* TO username@localhost IDENTIFIED BY 'paswd')Via cron, secara berkala (15 menit) database di restore.

Page 14: Technical Aspects of SLiMS

Contoh Implementasi (2)

Sebuah Institusi Pemerintah & instansi swasta bidang perminyakan

ProductionServer

StaffLibrary

Staff

MS ActiveDirectory Server

request/response

request/response

Intranet / LAN Internet / DMZ

Librarian & member login via LDAP for single

sign-on support

Page 15: Technical Aspects of SLiMS

SLiMS Hardening Tips

Hendro Wicaksono

Page 16: Technical Aspects of SLiMS

Separate database access.

Page 17: Technical Aspects of SLiMS

Separate database access (1)

Read-Only for OPACFull Access for Librarian Login

Page 18: Technical Aspects of SLiMS

Separate database access (2)

Read-Only for OPACGRANT SELECT ON senayandb.* TO opacuser@localhost IDENTIFIED BY 'password_rahasia';GRANT UPDATE ON senayandb.member TO opacuser@localhost;

Full Access for Librarian LoginGRANT ALL PRIVILEGES ON senayandb.* TO slimsadmin@localhost IDENTIFIED BY 'password_rahasia_juga';

FLUSH PRIVILEGES;

Page 19: Technical Aspects of SLiMS

Separate database access (3)

Create 2 sysconfig files:sysconfig.inc.php

sysconfig-opac.inc.php

Page 20: Technical Aspects of SLiMS

Separate database access (4)

In sysconfig-opac.inc.php:define('DB_USERNAME', 'opacuser');define('DB_PASSWORD', 'password_rahasia');

In sysconfig.inc.php:define('DB_USERNAME', 'slimsadmin');define('DB_PASSWORD', 'password_rahasia_juga');

Page 21: Technical Aspects of SLiMS

Separate database access (5)

Edit index.php:

require '../sysconfig.inc.php';

change to

require '../sysconfig-opac.inc.php';

Page 22: Technical Aspects of SLiMS

Separate database access (6)

Since SLiMS version 3 stable 15 (matoa), just copy

sysconfig.local.inc.php to sysconfig.local.fa.inc.php and adjust

the database connection setting for admin user.

Page 23: Technical Aspects of SLiMS

Access Restriction based on IP Address to Librarian

Login.

Page 24: Technical Aspects of SLiMS

IP Restriction to LibLogin

Edit lib/contents/login.inc.php:

$allowed_liblogin_ip = array('127.0.0.1');$remote_addr = $_SERVER['REMOTE_ADDR'];$confirmation = 0;

foreach ($allowed_liblogin_ip as $ip) { if ($ip == $remote_addr) { $confirmation = 1; }}

if (!$confirmation) { header ("location:index.php");}

Page 25: Technical Aspects of SLiMS

HTTP Secure Connection to Librarian Login

Page 26: Technical Aspects of SLiMS

HTTPS Secure Connection (1)

Edit lib/contents/login.inc.php:

if ($_SERVER['SERVER_PORT'] != '443') { header ("location:index.php");}

Page 27: Technical Aspects of SLiMS

HTTPS Secure Connection (2)

Edit admin/index.php:

if ($_SERVER['SERVER_PORT'] != '443') { header ("location:../index.php");}

Page 28: Technical Aspects of SLiMS

Security by obscurity (1)

Remove link to Librarian Login in OPAC

Page 29: Technical Aspects of SLiMS

Security by obscurity (2)

<li><a class="menu" href="index.php?p=login"><span><?php echo __('Librarian LOGIN'); ?></span></a></li>

Change to

<!-- <li><a class="menu" href="index.php?p=login"><span><?php echo __('Librarian LOGIN'); ?></span></a></li> →

Or delete the line.

Page 30: Technical Aspects of SLiMS

Do not use shared account. Every staff should login with

their own account.

Separate Account for Staffs

Page 31: Technical Aspects of SLiMS

Choose the right Operating System for your needs.

Choose the Right OS

Page 32: Technical Aspects of SLiMS

Suhosin!

sudo apt-get install php5-suhosin

PHP Hardening

Page 33: Technical Aspects of SLiMS

MySQL Hardening

Page 34: Technical Aspects of SLiMS

Apache Hardening

Page 35: Technical Aspects of SLiMS
Page 36: Technical Aspects of SLiMS

Choose the web server with built-in security features

Page 37: Technical Aspects of SLiMS

PHP Accelerator/Opcode cache

Performance tuning

sudo apt-get install php-apc

APC

sudo apt-get install php5-xcache

xcache

Page 38: Technical Aspects of SLiMS

Diskusi