4

安装openfire后无法登录管理界面解决办法

 2 years ago
source link: https://www.hi-roy.com/posts/%E5%AE%89%E8%A3%85openfire%E5%90%8E%E6%97%A0%E6%B3%95%E7%99%BB%E5%BD%95%E7%AE%A1%E7%90%86%E7%95%8C%E9%9D%A2%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

安装openfire后无法登录管理界面解决办法

2014-10-11

最近需要搭建一套live chat,于是选中了openfire这个比较不错的开源软件。至于介绍、安装等步骤这里不再介绍,记录一下我搭建完毕后遇到一个奇葩的问题:建立管理员账户后却无法登录后台,提示帐号不存在或者密码错误,版本是3.9.3。

解决办法就是直接修改数据库的<span class="syntax"><span class="inner_sql"><span class="syntax_quote syntax_quote_backtick">ofUser</span></span></span>表,发现它有两个和密码有关的字段:plainpassword和encryptedpassword,分别对应未加密和加密后的密码。当我们在web页面进行初始化设置时会让我们设定一个管理员密码,此时数据库中plainpassword被设置成为了null,后一个则是被加密的字符串。

我们要做的就是把plainpassword改称明文密码,encryptedpassword改成null。然后重起openfire服务就能登录了。

这里我还遇到两个坑:

  1. 使用service openfire start启动服务后,必须等一会才会生效,不知道是不是因为java的东西都这样。
  2. 使用安装目录下的openfire.sh启动并设置完成后,再使用service方式启动你会发现醋要重新配置,但设置数据库时候就报错,需要卸载程序后重新安装,所以建议直接使用service方式启动并初始化程序。

顺便提供一个centos下的重新安装的脚本:

#/bin/sh
echo "remove openfire..."
rpm -e openfire-3.9.3-1.i386
sleep 10
echo "clear file"
rm -rf /opt/openfire/
sleep 3
echo "install new openfire"
rpm -ivh /root/openfire-3.9.3-1.i386.rpm
sleep 10
echo "start service"
service openfire start
sleep 10
echo "sucess"
Roy avatar
About Roy
野生程序猿,略懂Python,略懂Golang,略懂云计算,略懂大数据,略懂拳击游泳钓鱼,略懂钢琴吉他摄影。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK