Untuk kesempatan ini saya akan memberikan tutorial instalasi Mod_Archive di Ejabberd2. Modul Archive ini digunakan untuk menyimpan history chat di server, dalam hal ini saya menggunakan mysql database.
Biasanya user menyimpan history chat di hard disk lokal komputer, tetapi pada suatu saat menggunakan mobile phone, atau di public access machine ingin melihat history chat, maka melalui implemantasi XEP-0136 jabber client bisa meminta server untuk mengambil arsip history dari server.
Di sini saya tidak jelaskan cara instalasi ejabberd server, tetapi hanya dijelaskan instalasi modul archive nya saja. Ejabberd-modules merupakan SVN repository karena itu harus di download menggunakan subversion client.
1. Download semua modul ejabberd menggunakan SVN
2. Masuk ke modul archivesvn co https://svn.process-one.net/ejabberd-modules
3. Edit file Emakefile , ubah "trunk" menjadi "ejabberd-dev/branches"cd ejabberd-modules/mod_archive/trunk
4. Compile module dengan perintah
./build.sh5. Copy .beam file di beam folder ke folder di mana beam file berada. Contoh karena saya insall dari binary ejabberd versi 2.1.11 maka saya asusmsikan beam folder di /usr/local/ejabberd/lib/ejabberd-2.1.11/ebin/
6. Tambahkan di database ejabberd table dan function dari sql file di folder src sesuai database yang digunakan: mod_archive_odbc_mysql.sql
7. Edit ejabberd.cfg tambahakan mod_archive di bagian module :
{mod_archive_odbc, [{database_type, "mysql"},Paramater di atas dijelaskan di bawah ini, terjamahin sendiri ya binggung kalau mau artikan bahasa tekhnisnya, agan-agan pasti juga paham.
{default_auto_save, true},
{enforce_default_auto_save, true},
{default_expire, infinity},
{enforce_min_expire, 0},
{enforce_max_expire, infinity},
{replication_expire, 31536000},
{session_duration, 1800},
{wipeout_interval, 86400}]},
database_type
- selects RDBMS type, currently “mysql”, “sqlite”, and “pgsql” are supported. This parameter should always be specified, all subsequent parameters are optional.default_auto_save
(true or false, defaults to false) - whether to perform auto-saving by default or not; please note that XEP-136 requires it to be off by default.enforce_default_auto_save
(true or false, defaults to false) - whether to enforcedefault_auto_save
option by prohibiting users changing it individually in their preferences or not.session_duration
(time in seconds) - the timeout interval the server uses to decide that conversation is over when performing automated archiving.default_expire
(time in seconds or infinity atom, defaults to infinity) - all collections with their start time satisfyingnow() - start() >= default_expire
will be removed, unless expire time is overridden by users in their preferences.enforce_min_expire
(time in seconds, defaults to 0) - minimal expire time users are allowed to set in their preferences, useful if you’d like to enforce some message saving policy. NOTE: this parameter is not currently checked in modification commands, such as “upload collection” or “remove collection”, so you cannot enforce the policy completely yet!enforce_max_expire
(time in seconds or infinity atom, defaults to infinity)- maximum expire time user is allowed to set, useful for limiting the amount of collections users may keep on server.
replication_expire
(time in seconds or infinity atom, defaults to 31536000, which is one year) - all collections with their removal time satisfyingnow() - removal_time() >= replication_expire
will be removed completely from the database, thus the server completely forgets they were present once.wipeout_interval
(time in seconds or infinity atom, defaults to 86400, which is one day) - interval between executions of expire routine.
Tidak ada komentar:
Posting Komentar