1 下载安装包
https://projects.tigase.org/projects/tigase-server/files
从中选一个,我这边选的是 tigase-server-5.1.0-beta2-b2555.tar.gz
2 上传到linux服务器,解压
tar -zxvf tigase-server-5.1.0-beta2-b2555.tar.gz
3 进入 tigase目录
cd tigase-server-5.1.0-beta2-b2555
4 赋予权限
chmod u+x ./scripts/tigase.sh
chmod u+x ./scripts/db-create-mysql.sh
5 安装java--- yum -y install java-1.7.0-openjdk*
设置JAVA_HOME
vi etc/tigase.conf
JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.101.x86_64
JRE_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.101.x86_64/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH
保存退出
6 设置初始化配置文件:vi etc/init.properties
config-type=--gen-config-def
--admins=admin@127.0.0.1
--virt-hosts =127.0.0.1
--debug=server
--monitoring=jmx:9050,http:9080,snmp:9060
--user-db=mysql
--user-db-uri=jdbc:mysql://127.0.0.1:3306/tigasedb?user=root&password=123456&useUnicode=true&characterEncoding=UTF-8
--comp-name-1 = muc
--comp-class-1 = tigase.muc.MUCComponent
--comp-name-2 = pubsub
--comp-class-2 = tigase.pubsub.PubSubComponent
--sm-plugins=-starttls(这个很重要,使用这个设置,不开启SSL)
以上是例子
保存退出
7 初始化数据库
./scripts/db-create-mysql.sh database/mysql-installer-create-db.sql 123456 tigasedb root 123456 localhost
8 启动tigase服务器
./scripts/tigase.sh start etc/tigase.conf
期间可能会出现以下情况
tigase.db.DBInitException: Problem initializing jdbc connection: null
at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.Java:828)
at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:318)
at tigase.server.xmppsession.SessionManager.setProperties(SessionManager.java:678)
at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:880)
at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:218)
at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:71)
at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)
at tigase.server.MessageRouter.addComponent(MessageRouter.java:131)
at tigase.server.MessageRouter.addRouter(MessageRouter.java:171)
at tigase.server.MessageRouter.setProperties(MessageRouter.java:697)
at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:880)
at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:218)
at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:71)
at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)
at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:157)
at tigase.server.MessageRouter.setConfig(MessageRouter.java:603)
at tigase.server.XMPPServer.main(XMPPServer.java:135)
Caused by: java.lang.NullPointerException
at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.java:784)
at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:318)
at tigase.server.xmppsession.SessionManager.setProperties(SessionManager.java:678)
at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:880)
at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:218)
at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:71)
at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)
at tigase.server.MessageRouter.addComponent(MessageRouter.java:131)
at tigase.server.MessageRouter.addRouter(MessageRouter.java:171)
at tigase.server.MessageRouter.setProperties(MessageRouter.java:697)
at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:880)
at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:218)
at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:71)
at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)
at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:157)
at tigase.server.MessageRouter.setConfig(MessageRouter.java:603)
at tigase.server.XMPPServer.main(XMPPServer.java:135)
登陆mysql ,执行
mysql -u root -p passwod
mysql >grant all privileges on *.* to root@"%" identified by "Passwd"
mysql >flush privileges;
执行
./scripts/tigase.sh restart etc/tigase.conf
然后用Spark注册连接吧,应该没问题了