* 编译安装 $ 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>
|
|
| 日 | 一 | 二 | 三 | 四 | 五 | 六 |
---|
27 | 28 | 29 | 30 | 31 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|
常用链接
留言簿(5)
随笔档案
文章分类
文章档案
搜索
最新评论
阅读排行榜
评论排行榜
|
|