下面开始介绍我是如何安装openfire的
第一步:升级一下yum
#yum update
第二步:安装系统中缺少的JAVA插件,以及jdk-7u71-linux-x64.rpm下载
#yum -y install java* wget*
#wget -c -P /root/Downloads --no-check-certificate --no-cookie --header "Cookie: s_nr=1420682671945; s_cc=true; oraclelicense=accept-securebackup-cookie; gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk7-downloads-1880260.html;s_sq=%5B%5BB%5D%5D" http://download.oracle.com/otn-pub/java/jdk/7u71-b14/jdk-7u71-linux-x64.rpm
- mkdir /usr/java/
- cp jdk-7u71-linux-x64.rpm /usr/java/
-
- 在/usr/java/目录下执行:
- rpm -ivh jdk-7u25-linux-x64.rpm
- Preparing... ########################################### [100%]
- 1:jdk ########################################### [100%]
- Unpacking JAR files...
- rt.jar...
- jsse.jar...
- charsets.jar...
- tools.jar...
- localedata.jar...
-
第三步:配置java环境
打开配置文件
#vim /etc/profile
在文件末尾添加内容如下
export JAVA_HOME=/usr/java/jdk1.7.0_71
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
保存退出(注:要根据已安装的实际版本对第一行进行修改)
#source /etc/profile
即可生效
第四步:下载openfire在linux下的安装包
下载地址
http://www.igniterealtime.org/downloads/index.jsp#openfire
第五步:使用命令安装
如果下载的是rpm
#rpm -ivh openfire-3_10_3.rpm
默认安装到/opt/openfire目录下
如果下载的是tar包,上传到/opt
#tar –xzvf openfire_3_10_3.tar.gz
#cp openfire/bin/openfire /etc/init.d
第六步:在linux上启动oepnfire
# /etc/init.d/openfire
Usage /etc/init.d/openfire {start|stop|restart|status|condrestart|reload}
# /etc/init.d/openfire start
设置为开机自启动
# chkconfig openfire on
# chkconfig --list openfire
openfire 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
设置成功!
第七步:开放防火墙9090端口
#/sbin/iptables -I INPUT -p tcp --dport 9090 -j ACCEPT #为指定端口9090
#/etc/rc.d/init.d/iptables save #将更改进行保存
#/etc/init.d/iptables restart #重启防火墙以便改动生效
第八步:打开浏览器,输入http://[公网或私网ip]:9090/进入配置界面
配置完后:进入一下界面登录
登入进去后: