* 編譯安裝
$ wget http://download.jabberd.org/jabberd14/jabberd14-1.6.1.1.tar.gz
$ tar xzvf jabberd14-1.6.1.1.tar.gz
$ cd jabberd14-1.6.1.1
修改代碼以通過編譯:
diff -r jabberd14-1.6.1.1/jabberd/lib/xmlnode.cc tmp/jabberd14-1.6.1.1/jabberd/lib/xmlnode.cc
882,884c882,884
<???? const char *next_step = NULL;
<???? const char *start_predicate = NULL;
<???? const char *end_predicate = NULL;
---
>???? char *next_step = NULL;
>???? char *start_predicate = NULL;
>???? char *end_predicate = NULL;
1836c1836
< ??? ??? ((char*)strchr(lang, '-'))[0] = 0;
---
> ??? ??? strchr(lang, '-')[0] = 0;
diff -r jabberd14-1.6.1.1/jabberd/log.cc tmp/jabberd14-1.6.1.1/jabberd/log.cc
89c89
<???????? pos = (char*)strchr(zone,'.');
---
> ??? pos = strchr(zone,'.');
diff -r jabberd14-1.6.1.1/jabberd/mio_tls.cc tmp/jabberd14-1.6.1.1/jabberd/mio_tls.cc
615c615
< ??? ??? ret = gnutls_certificate_set_openpgp_key_file(current_credentials, pubfile, privfile, GNUTLS_OPENPGP_FMT_BASE64);
---
> ??? ??? ret = gnutls_certificate_set_openpgp_key_file(current_credentials, pubfile, privfile);
634c634
< ??? ??? ret = gnutls_certificate_set_openpgp_keyring_file(current_credentials, file, GNUTLS_OPENPGP_FMT_BASE64);
---
> ??? ??? ret = gnutls_certificate_set_openpgp_keyring_file(current_credentials, file);
640a641,657
> ??? }
>
> ??? // load GnuPG trustdb
> ??? if (j_strcmp(xmlnode_get_localname(cur), "trustdb") == 0) {
> ??? ??? char const *const file = xmlnode_get_data(cur);
>
> ??? ??? if (file == NULL) {
> ??? ??? log_warn(NULL, "Initializing TLS subsystem: <trustdb/> element inside the TLS configuration, that does not contain a file-name.");
> ??? ??? continue;
> ??? ??? }
>
> ??? ??? // load the GnuPG trustdb
> ??? ??? ret = gnutls_certificate_set_openpgp_trustdb(current_credentials, file);
> ??? ??? if (ret < 0) {
> ??? ??? log_error(NULL, "Error loading GnuPG trustdb %s: %s", file, gnutls_strerror(ret));
> ??? ??? continue;
> ??? ??? }
$ ./configure && make && sudo make install? # 需要用新立得安裝提示缺少的庫

* 配置
** 按照mysql.sql中的注釋配置數據庫:
$ mysql -uroot -p
mysql> CREATE DATABASE jabber CHARACTER SET utf8;
mysql> use jabber;
mysql> grant all on jabber.* to jabber@localhost identified by 'secret';
mysql> \. mysql.sql

* 運行
sudo jabberd -h localhost -B

* 注冊用戶1
telnet localhost 5222
<stream:stream
? to='localhost'
? xmlns='jabber:client'
? xmlns:stream='http://etherx.jabber.org/streams'>

<iq id='reg1' type='set'>
? <query xmlns='jabber:iq:register'>
??? <username>jack</username>
??? <password>jack</password>
??? <name>jack</name>
??? <email></email>
? </query>
</iq>

</stream:stream>

* 登錄用戶1
Empathy菜單->編輯->帳戶->添加:
協議: Jabber
登錄ID: jack@localhost
記住密碼
密碼: jack
登錄

* 注冊用戶2
telnet localhost 5222
<stream:stream
? to='localhost'
? xmlns='jabber:client'
? xmlns:stream='http://etherx.jabber.org/streams'>

<iq id='reg1' type='set'>
? <query xmlns='jabber:iq:register'>
??? <username>rose</username>
??? <password>rose</password>
??? <name>rose</name>
??? <email></email>
? </query>
</iq>

</stream:stream>

* 用戶1加用戶2為聯系人
Empathy菜單->聊天->添加聯系人:
帳戶:jack@localhost
標識符: rose@localhost
添加

* 登錄用戶2,并發一個消息給用戶1
telnet localhost 5222
<stream:stream
? to='localhost'
? xmlns='jabber:client'
? xmlns:stream='http://etherx.jabber.org/streams'>

<iq id='auth1' type='set'>
? <query xmlns='jabber:iq:auth'>
??? <username>rose</username>
??? <password>rose</password>
??? <resource>test</resource>
? </query>
</iq>

<presence/>

<message to='jack@localhost'>
? <body>hello, jack</body>
</message>

</stream:stream>