假设本机已经成功安装了MySQL数据库java
A:搭建Tigasemysql
官方安装文档:http://www.tigase.org/content/manual-installation-console-modesql
1:下载架包并解压缩数据库
/usr/local/tigase-server-5.1.4-b2998服务器
2:修改./scripts/tigase.sh文件为可执行文件dom
chmod u+x./scripts/tigase.shjvm
3:修改配置文件测试
修改tigase.conf的java路径this
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_03.net
修改init.properties文件的配置。
--admins=zcx@domain.com
--virt-hosts = domain.com
--debug=server
--user-db=mysql
--user-db-uri=jdbc:mysql://localhost:3306/tigase?user=root&password=xxx&useUnicode=true&characterEncoding=UTF-8&autoCreateUser=true
其余的扩展组建,集群,插件等配置,参考官方init.properties配置文件所名
http://www.tigase.org/content/tigase-xmpp-server-configuration-properties
4:执行建立表的SQL
执行./scripts/db-create-mysql.sh文件,建立表。具体参数忘记了,执行时,会提示错误,并指定所需参数及格式
5:启动server
./scripts/tigase.sh startetc/tigase.conf
./scripts/tigase.sh stopetc/tigase.conf
./scripts/tigase.shrestart etc/tigase.conf
6:检查是否成功启动
查看logs文件夹下tigase-console和tigase.log的输出
B:配置pidgin
能够配置pidgin来连接搭建的tigase,实现聊天及测试。
1:安装pidgin,完成以后经过控制端输入pidgin启动界面
2:首次进入时,由于没有建立的Accounts,因此列表中为空
3:点击Add,弹出添加页面。
Basic面板页
Protocol:选着XMPP协议
userName:在面板中显示的用户名
Domain:上面init.properties中配置的virt-host
Password:登陆须要使用的密码
Advanced面板也
Connect port:使用默认的5222
Connect server:tigase服务器的地址,由于搭建在本地,因此我这使用的是localhost
选中下面的create this new account on server。点击Add
再次弹出的页面须要填写用户名密码,改用户名密码做为登陆帐号,上面填写的用户名在面板中显示。点击Register,将用户保存到数据库
4:点击Enabled复选框,实现相应的帐号登陆。
登陆以后,点击登陆后Buddy List的New Instant Message,在弹出框里输入你但愿聊天的用户。这里须要使用“帐号@域名”的格式
5:若是对方在线,即会收到消息,若是不在线,会做为离线消息保存到数据库,在登陆时,即会收到消息。