yichat接口源码
在linux服务器上自行安装 JDK1.8、mysql和redis。
tigase包下载
链接:https://pan.baidu.com/s/1RqE-eqvV5NCvnJl9GGyMiQ 密码:hwhy
tar zxvf tigase.tar.gz -C /usr/local/
ln -s /usr/local/tigase/scripts/tigase.sh /usr/bin/tigase
vi /etc/profile
在最后加入
export TIGASE_HOME=/usr/local/tigase
保存退出,并执行 source /etc/profile
使配置文件立即生效。
mysql -u root -p
grant all on *.* to tigase@'%' identified by 'aa12345';
grant all on *.* to tigase@'localhost' identified by 'aa12345';
flush privileges;
创建tigase数据库
create database tigase;
导入数据sql,文件在项目config文件夹中
https://github.com/YiChat/yichat-server/blob/master/api/src/main/resources/config/tigase.sql
tigase start
tigase stop
create database api;
导入数据sql,文件在项目config文件夹中
https://github.com/YiChat/yichat-server/blob/master/api/src/main/resources/config/api.sql
一般通过IDEA插件打成jar的形式上传服务器,写个简单的脚本执行
vi exec.sh
输入下面文本
ps -ef | grep api-1.0-SNAPSHOT-exec.jar | awk '{print $2}' | xargs kill -9 nohup java -jar api-1.0-SNAPSHOT-exec.jar --spring.profiles.active=yichat &
然后执行 sh exec.sh即可启动成功
https://github.com/YiChat/yichat-server/blob/master/api/src/main/resources/application-yichat.yml