下面开始介绍我是如何安装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

  1. mkdir /usr/java/  
  2. cp jdk-7u71-linux-x64.rpm /usr/java/ 

  3. 在/usr/java/目录下执行:
  4. rpm -ivh jdk-7u25-linux-x64.rpm
  5. Preparing...                ########################################### [100%]  
  6. 1:jdk                    ########################################### [100%]
  7. Unpacking JAR files...
  8.     rt.jar...
  9.     jsse.jar...
  10.     charsets.jar... 
  11.     tools.jar...
  12.     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

保存退出(注:要根据已安装的实际版本对第一行进行修改

#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/进入配置界面

配置完后:进入一下界面登录


登入进去后:


openfire 服务器端口 说明

接口               端口           类型                      描述
所有的地址     5222         客户端到服务器     客户端使用标准端口连接到服务器,连接可能没有加密,您可以更新安全设                                                                       置 为这个端口
所有的地址     5223         客户端到服务器     客户端使用旧的SSL方法连接到服务器的端口。旧的SSL方法不是一个                                                                                XMPP标准方法,在不久将不被支持,您可以更新安全设置 为这个端口
所有的地址     9090         管理控制台            端口使用不安全的管理控制台访问.
所有的地址     9091         管理控制台             端口使用安全的管理控制台访问.
所有的地址     7777         文件传送代理服务器     代理服务使用的端口允许在XMPP网络上的两个实体使用文件传送
所有的地址     7070         HTTP绑定               使用不安全的HTTP客户端连接端口
所有的地址     7443         HTTP绑定               使用安全的HTTP客户端连接端口
所有的地址     10000 - 20000                         实时媒体代理服务器     代理服务使用的端口允许在XMPP网络上两个实体                                                                        之间进行Jingle连接.
所有的地址     3478 & 3479   STUN服务器     端口用于确保实体之间在NAT下的连接.
所有的地址     5229         Flash Cross Domain     Service that allows Flash clients connect to other hostnames and ports.