最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】在CentOS 6.6中安装OpenFire

Openfire crifan 4865浏览 0评论

【背景】

需要在远程的CentOS 6.6的主机中安装Openfire。

【折腾过程】

1.搜:

openfire centos 6

openfire centos

参考:

Install OpenFire 3.8.1 on CentOS 6.4 x86_64 – The Official Blog of Richard Ricketts

Openfire: Installation Guide

CentOS 64位 安装openfire | 在这里-迦楠的后花园

centos安装openfire – k12104的专栏 – 博客频道 – CSDN.NET

通过官网:

http://www.igniterealtime.org/downloads/

去下载最新的openfire:

http://www.igniterealtime.org/downloads/download-landing.jsp?file=openfire/openfire-3.10.2-1.i386.rpm

2.去操作:

先去更新一下:

yum update

先去安装java:

【记录】CentOS 6.6中安装Java

3.再去安装wget:

[root@bogon ~]# yum install wget
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * atomic: mirrors.hosting.in.th
 * base: mirrors.163.com
 * extras: mirrors.btte.net
 * updates: mirrors.163.com
Package wget-1.12-5.el6_6.1.x86_64 already installed and latest version
Nothing to do

4.然后再根据官网去安装:

Ignite Realtime: Openfire Server

Openfire: Installation Guide

Openfire: Database Installation Guide

去下载:

[root@bogon ~]# wget http://download.igniterealtime.org/openfire/openfire-3.10.2-1.i386.rpm
--2015-07-06 08:00:07--  http://download.igniterealtime.org/openfire/openfire-3.10.2-1.i386.rpm
Resolving download.igniterealtime.org... 54.240.168.254, 54.240.168.86, 54.240.168.12, ...
Connecting to download.igniterealtime.org|54.240.168.254|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 68802464 (66M) [application/x-rpm]
Saving to: 鈥渙penfire-3.10.2-1.i386.rpm鈥?

100%[==========================================================================================>] 68,802,464   102K/s   in 15m 54s 

2015-07-06 08:16:02 (70.5 KB/s) - 鈥渙penfire-3.10.2-1.i386.rpm鈥?saved [68802464/68802464]

再去安装:

[root@bogon ~]# yum install openfire-3.10.2-1.i386.rpm 
Loaded plugins: fastestmirror
Setting up Install Process
Examining openfire-3.10.2-1.i386.rpm: openfire-3.10.2-1.i386
Marking openfire-3.10.2-1.i386.rpm to be installed
Loading mirror speeds from cached hostfile
 * atomic: mirrors.hosting.in.th
 * base: mirrors.163.com
 * extras: mirrors.btte.net
 * updates: mirrors.163.com
atomic                                                                                                       | 3.4 kB     00:00  
base                                                                                                         | 3.7 kB     00:00    
extras                                                                                                       | 3.4 kB     00:00    
updates                                                                                                      | 3.4 kB     00:00 
Resolving Dependencies
--> Running transaction check
---> Package openfire.i386 0:3.10.2-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                     Arch                    Version                       Repository                          Size
====================================================================================================================================
Installing:
 openfire                    i386                    3.10.2-1                      /openfire-3.10.2-1.i386        179 M

Transaction Summary
====================================================================================================================================
Install       1 Package(s)

Total size: 179 M
Installed size: 179 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : openfire-3.10.2-1.i386                                                                                      1/1 
  Verifying  : openfire-3.10.2-1.i386                                                                                      1/1 

Installed:
  openfire.i386 0:3.10.2-1                                                                                                     

Complete!
[root@bogon ~]# 

5. 再去启动,没有启动成功:

【已解决】CentOS 6.6中安装了openfire 3.10.2但是无法启动

6.参考:

Diantokam: Installing OpenFire on CentOS 6.0 (64 Bit)

再去安装那个x86的库:

[root@bogon ~]# yum install glibc.i686
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * atomic: mirrors.hosting.in.th
 * base: mirrors.163.com
 * extras: mirrors.btte.net
 * updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package glibc.i686 0:2.12-1.149.el6_6.9 will be installed
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.12-1.149.el6_6.9.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.12-1.149.el6_6.9.i686
--> Running transaction check
---> Package nss-softokn-freebl.i686 0:3.14.3-22.el6_6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                              Arch                   Version                                Repository         Size
====================================================================================================================================
Installing:
 glibc                                i686                   2.12-1.149.el6_6.9                     updates            4.3 M
Installing for dependencies:
 nss-softokn-freebl                   i686                   3.14.3-22.el6_6                        updates     157 k

Transaction Summary
====================================================================================================================================
Install       2 Package(s)

Total download size: 4.5 M
Installed size: 14 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): glibc-2.12-1.149.el6_6.9.i686.rpm                                                                     | 4.3 MB     00:06     
(2/2): nss-softokn-freebl-3.14.3-22.el6_6.i686.rpm                                                           | 157 kB     00:00     
------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                               482 kB/s | 4.5 MB     00:09     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : glibc-2.12-1.149.el6_6.9.i686                                                                            1/2 
  Installing : nss-softokn-freebl-3.14.3-22.el6_6.i686                                                           2/2 
  Verifying  : nss-softokn-freebl-3.14.3-22.el6_6.i686                                                          1/2 
  Verifying  : glibc-2.12-1.149.el6_6.9.i686                                                                            2/2 

Installed:
  glibc.i686 0:2.12-1.149.el6_6.9                                                                                           

Dependency Installed:
  nss-softokn-freebl.i686 0:3.14.3-22.el6_6                                                                          

Complete!
[root@bogon ~]# 

7.再去配置端口:

[root@bogon ~]# iptables -I INPUT -p tcp --dport 9090 -j ACCEPT
[root@bogon ~]# /etc/rc.d/init.d/iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables: [  OK  ]
[root@bogon ~]# /etc/init.d/iptables restart
iptables: Setting chains to policy ACCEPT: filter [  OK  ]
iptables: Flushing firewall rules: [  OK  ]
iptables: Unloading modules: [  OK  ]
iptables: Applying firewall rules: [  OK  ]
[root@bogon ~]# 

接着就是去折腾mysql数据库的事情了。

 

8.先去创建一个数据库:

[root@bogon ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 21082
Server version: 5.5.44-cll-lve MySQL Community Server (GPL) by Atomicorp

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database openfire_xxx;
Query OK, 1 row affected (0.00 sec)

mysql> exit
Bye
[root@bogon ~]# 

9.先去看看openfire中的mysql的配置:

[root@bogon ~]# ls /opt/
openfire
[root@bogon ~]# ls /opt/openfire/ -la
total 248
drwxr-x---  10 daemon daemon   4096 Jul  6 17:21 .
drwxr-xr-x.  3 root   root     4096 Jul  6 17:21 ..
drwxr-xr-x   2 daemon daemon   4096 Jul  6 17:21 bin
-rw-r--r--   1 daemon daemon 189876 Jun 23 01:36 changelog.html
drwxr-xr-x   2 daemon daemon   4096 Jul  6 17:21 conf
drwxr-xr-x   4 daemon daemon   4096 Jul  6 17:21 documentation
drwxr-xr-x   6 daemon daemon   4096 Jul  6 17:21 jre
drwxr-xr-x   2 daemon daemon   4096 Jul  6 17:21 lib
-rw-r--r--   1 daemon daemon  10871 Jun 23 01:36 LICENSE.html
drwxr-xr-x   2 daemon daemon   4096 Jul  6 17:22 logs
drwxr-xr-x   3 daemon daemon   4096 Jul  6 17:21 plugins
-rw-r--r--   1 daemon daemon   5333 Jun 23 01:36 README.html
drwxr-xr-x   7 daemon daemon   4096 Jul  6 17:21 resources
[root@bogon ~]# ls /opt/openfire/resources/
database/   i18n/       nativeAuth/ security/   spank/      
[root@bogon ~]# ls /opt/openfire/resources/database/ -la
total 124
drwxr-xr-x  3 daemon daemon  4096 Jul  6 17:21 .
drwxr-xr-x  7 daemon daemon  4096 Jul  6 17:21 ..
-rw-r--r--  1 daemon daemon 13876 Jun 23 01:36 openfire_db2.sql
-rw-r--r--  1 daemon daemon 14571 Jun 23 01:36 openfire_hsqldb.sql
-rw-r--r--  1 daemon daemon 12970 Jun 23 01:36 openfire_mysql.sql
-rw-r--r--  1 daemon daemon 14405 Jun 23 01:36 openfire_oracle.sql
-rw-r--r--  1 daemon daemon 14348 Jun 23 01:36 openfire_postgresql.sql
-rw-r--r--  1 daemon daemon 14408 Jun 23 01:36 openfire_sqlserver.sql
-rw-r--r--  1 daemon daemon 14482 Jun 23 01:36 openfire_sybase.sql
drwxr-xr-x 22 daemon daemon  4096 Jul  6 17:21 upgrade
[root@bogon ~]# cat /opt/openfire/resources/database/openfire_mysql.sql 
# $Revision: 1650 $
# $Date: 2005-07-20 00:18:17 -0300 (Wed, 20 Jul 2005) $

CREATE TABLE ofUser (
  username              VARCHAR(64)     NOT NULL,
  plainPassword         VARCHAR(32),
  encryptedPassword     VARCHAR(255),
  name                  VARCHAR(100),
  email                 VARCHAR(100),
  creationDate          CHAR(15)        NOT NULL,
  modificationDate      CHAR(15)        NOT NULL,
  PRIMARY KEY (username),
  INDEX ofUser_cDate_idx (creationDate)
);

CREATE TABLE ofUserProp (
  username              VARCHAR(64)     NOT NULL,
  name                  VARCHAR(100)    NOT NULL,
  propValue             TEXT            NOT NULL,
  PRIMARY KEY (username, name)
);

CREATE TABLE ofUserFlag (
  username              VARCHAR(64)     NOT NULL,
  name                  VARCHAR(100)    NOT NULL,
  startTime             CHAR(15),
  endTime               CHAR(15),
  PRIMARY KEY (username, name),
  INDEX ofUserFlag_sTime_idx (startTime),
  INDEX ofUserFlag_eTime_idx (endTime)
);

CREATE TABLE ofPrivate (
  username              VARCHAR(64)     NOT NULL,
  name                  VARCHAR(100)    NOT NULL,
  namespace             VARCHAR(200)    NOT NULL,
  privateData           TEXT            NOT NULL,
  PRIMARY KEY (username, name, namespace(100))
);

CREATE TABLE ofOffline (
  username              VARCHAR(64)     NOT NULL,
  messageID             BIGINT          NOT NULL,
  creationDate          CHAR(15)        NOT NULL,
  messageSize           INTEGER         NOT NULL,
  stanza                TEXT            NOT NULL,
  PRIMARY KEY (username, messageID)
);

CREATE TABLE ofPresence (
  username              VARCHAR(64)     NOT NULL,
  offlinePresence       TEXT,
  offlineDate           CHAR(15)     NOT NULL,
  PRIMARY KEY (username)
);

CREATE TABLE ofRoster (
  rosterID              BIGINT          NOT NULL,
  username              VARCHAR(64)     NOT NULL,
  jid                   VARCHAR(1024)   NOT NULL,
  sub                   TINYINT         NOT NULL,
  ask                   TINYINT         NOT NULL,
  recv                  TINYINT         NOT NULL,
  nick                  VARCHAR(255),
  PRIMARY KEY (rosterID),
  INDEX ofRoster_unameid_idx (username),
  INDEX ofRoster_jid_idx (jid(255))
);

CREATE TABLE ofRosterGroups (
  rosterID              BIGINT          NOT NULL,
  rank                  TINYINT         NOT NULL,
  groupName             VARCHAR(255)    NOT NULL,
  PRIMARY KEY (rosterID, rank),
  INDEX ofRosterGroup_rosterid_idx (rosterID)
);

CREATE TABLE ofVCard (
  username              VARCHAR(64)     NOT NULL,
  vcard                 MEDIUMTEXT      NOT NULL,
  PRIMARY KEY (username)
);

CREATE TABLE ofGroup (
  groupName             VARCHAR(50)     NOT NULL,
  description           VARCHAR(255),
  PRIMARY KEY (groupName)
);

CREATE TABLE ofGroupProp (
  groupName             VARCHAR(50)     NOT NULL,
  name                  VARCHAR(100)    NOT NULL,
  propValue             TEXT            NOT NULL,
  PRIMARY KEY (groupName, name)
);

CREATE TABLE ofGroupUser (
  groupName             VARCHAR(50)     NOT NULL,
  username              VARCHAR(100)    NOT NULL,
  administrator         TINYINT         NOT NULL,
  PRIMARY KEY (groupName, username, administrator)
);

CREATE TABLE ofID (
  idType                INTEGER         NOT NULL,
  id                    BIGINT          NOT NULL,
  PRIMARY KEY (idType)
);

CREATE TABLE ofProperty (
  name        VARCHAR(100)              NOT NULL,
  propValue   TEXT                      NOT NULL,
  PRIMARY KEY (name)
);


CREATE TABLE ofVersion (
  name     VARCHAR(50)  NOT NULL,
  version  INTEGER  NOT NULL,
  PRIMARY KEY (name)
);

CREATE TABLE ofExtComponentConf (
  subdomain             VARCHAR(255)    NOT NULL,
  wildcard              TINYINT         NOT NULL,
  secret                VARCHAR(255),
  permission            VARCHAR(10)     NOT NULL,
  PRIMARY KEY (subdomain)
);

CREATE TABLE ofRemoteServerConf (
  xmppDomain            VARCHAR(255)    NOT NULL,
  remotePort            INTEGER,
  permission            VARCHAR(10)     NOT NULL,
  PRIMARY KEY (xmppDomain)
);

CREATE TABLE ofPrivacyList (
  username              VARCHAR(64)     NOT NULL,
  name                  VARCHAR(100)    NOT NULL,
  isDefault             TINYINT         NOT NULL,
  list                  TEXT            NOT NULL,
  PRIMARY KEY (username, name),
  INDEX ofPrivacyList_default_idx (username, isDefault)
);

CREATE TABLE ofSASLAuthorized (
  username            VARCHAR(64)   NOT NULL,
  principal           TEXT          NOT NULL,
  PRIMARY KEY (username, principal(200))
);

CREATE TABLE ofSecurityAuditLog (
  msgID                 BIGINT          NOT NULL,
  username              VARCHAR(64)     NOT NULL,
  entryStamp            BIGINT          NOT NULL,
  summary               VARCHAR(255)    NOT NULL,
  node                  VARCHAR(255)    NOT NULL,
  details               TEXT,
  PRIMARY KEY (msgID),
  INDEX ofSecurityAuditLog_tstamp_idx (entryStamp),
  INDEX ofSecurityAuditLog_uname_idx (username)
);

# MUC Tables

CREATE TABLE ofMucService (
  serviceID           BIGINT        NOT NULL,
  subdomain           VARCHAR(255)  NOT NULL,
  description         VARCHAR(255),
  isHidden            TINYINT       NOT NULL,
  PRIMARY KEY (subdomain),
  INDEX ofMucService_serviceid_idx (serviceID)
);

CREATE TABLE ofMucServiceProp (
  serviceID           BIGINT        NOT NULL,
  name                VARCHAR(100)  NOT NULL,
  propValue           TEXT          NOT NULL,
  PRIMARY KEY (serviceID, name)
);

CREATE TABLE ofMucRoom (
  serviceID           BIGINT        NOT NULL,
  roomID              BIGINT        NOT NULL,
  creationDate        CHAR(15)      NOT NULL,
  modificationDate    CHAR(15)      NOT NULL,
  name                VARCHAR(50)   NOT NULL,
  naturalName         VARCHAR(255)  NOT NULL,
  description         VARCHAR(255),
  lockedDate          CHAR(15)      NOT NULL,
  emptyDate           CHAR(15)      NULL,
  canChangeSubject    TINYINT       NOT NULL,
  maxUsers            INTEGER       NOT NULL,
  publicRoom          TINYINT       NOT NULL,
  moderated           TINYINT       NOT NULL,
  membersOnly         TINYINT       NOT NULL,
  canInvite           TINYINT       NOT NULL,
  roomPassword        VARCHAR(50)   NULL,
  canDiscoverJID      TINYINT       NOT NULL,
  logEnabled          TINYINT       NOT NULL,
  subject             VARCHAR(100)  NULL,
  rolesToBroadcast    TINYINT       NOT NULL,
  useReservedNick     TINYINT       NOT NULL,
  canChangeNick       TINYINT       NOT NULL,
  canRegister         TINYINT       NOT NULL,
  PRIMARY KEY (serviceID,name),
  INDEX ofMucRoom_roomid_idx (roomID),
  INDEX ofMucRoom_serviceid_idx (serviceID)
);

CREATE TABLE ofMucRoomProp (
  roomID                BIGINT          NOT NULL,
  name                  VARCHAR(100)    NOT NULL,
  propValue             TEXT            NOT NULL,
  PRIMARY KEY (roomID, name)
);

CREATE TABLE ofMucAffiliation (
  roomID              BIGINT        NOT NULL,
  jid                 TEXT          NOT NULL,
  affiliation         TINYINT       NOT NULL,
  PRIMARY KEY (roomID,jid(70))
);

CREATE TABLE ofMucMember (
  roomID              BIGINT        NOT NULL,
  jid                 TEXT          NOT NULL,
  nickname            VARCHAR(255)  NULL,
  firstName           VARCHAR(100)  NULL,
  lastName            VARCHAR(100)  NULL,
  url                 VARCHAR(100)  NULL,
  email               VARCHAR(100)  NULL,
  faqentry            VARCHAR(100)  NULL,
  PRIMARY KEY (roomID,jid(70))
);

CREATE TABLE ofMucConversationLog (
  roomID              BIGINT        NOT NULL,
  sender              TEXT          NOT NULL,
  nickname            VARCHAR(255)  NULL,
  logTime             CHAR(15)      NOT NULL,
  subject             VARCHAR(255)  NULL,
  body                TEXT          NULL,
  INDEX ofMucConversationLog_time_idx (logTime)
);

# PubSub Tables

CREATE TABLE ofPubsubNode (
  serviceID           VARCHAR(100)  NOT NULL,
  nodeID              VARCHAR(100)  NOT NULL,
  leaf                TINYINT       NOT NULL,
  creationDate        CHAR(15)      NOT NULL,
  modificationDate    CHAR(15)      NOT NULL,
  parent              VARCHAR(100)  NULL,
  deliverPayloads     TINYINT       NOT NULL,
  maxPayloadSize      INTEGER       NULL,
  persistItems        TINYINT       NULL,
  maxItems            INTEGER       NULL,
  notifyConfigChanges TINYINT       NOT NULL,
  notifyDelete        TINYINT       NOT NULL,
  notifyRetract       TINYINT       NOT NULL,
  presenceBased       TINYINT       NOT NULL,
  sendItemSubscribe   TINYINT       NOT NULL,
  publisherModel      VARCHAR(15)   NOT NULL,
  subscriptionEnabled TINYINT       NOT NULL,
  configSubscription  TINYINT       NOT NULL,
  accessModel         VARCHAR(10)   NOT NULL,
  payloadType         VARCHAR(100)  NULL,
  bodyXSLT            VARCHAR(100)  NULL,
  dataformXSLT        VARCHAR(100)  NULL,
  creator             VARCHAR(255) NOT NULL,
  description         VARCHAR(255)  NULL,
  language            VARCHAR(255)  NULL,
  name                VARCHAR(50)   NULL,
  replyPolicy         VARCHAR(15)   NULL,
  associationPolicy   VARCHAR(15)   NULL,
  maxLeafNodes        INTEGER       NULL,
  PRIMARY KEY (serviceID, nodeID)
);

CREATE TABLE ofPubsubNodeJIDs (
  serviceID           VARCHAR(100)  NOT NULL,
  nodeID              VARCHAR(100)  NOT NULL,
  jid                 VARCHAR(255)  NOT NULL,
  associationType     VARCHAR(20)   NOT NULL,
  PRIMARY KEY (serviceID, nodeID, jid(70))
);

CREATE TABLE ofPubsubNodeGroups (
  serviceID           VARCHAR(100)  NOT NULL,
  nodeID              VARCHAR(100)  NOT NULL,
  rosterGroup         VARCHAR(100)   NOT NULL,
  INDEX ofPubsubNodeGroups_idx (serviceID, nodeID)
);

CREATE TABLE ofPubsubAffiliation (
  serviceID           VARCHAR(100)  NOT NULL,
  nodeID              VARCHAR(100)  NOT NULL,
  jid                 VARCHAR(255) NOT NULL,
  affiliation         VARCHAR(10)   NOT NULL,
  PRIMARY KEY (serviceID, nodeID, jid(70))
);

CREATE TABLE ofPubsubItem (
  serviceID           VARCHAR(100)  NOT NULL,
  nodeID              VARCHAR(100)  NOT NULL,
  id                  VARCHAR(100)  NOT NULL,
  jid                 VARCHAR(255)  NOT NULL,
  creationDate        CHAR(15)      NOT NULL,
  payload             MEDIUMTEXT    NULL,
  PRIMARY KEY (serviceID, nodeID, id)
);

CREATE TABLE ofPubsubSubscription (
  serviceID           VARCHAR(100)  NOT NULL,
  nodeID              VARCHAR(100)  NOT NULL,
  id                  VARCHAR(100)  NOT NULL,
  jid                 VARCHAR(255) NOT NULL,
  owner               VARCHAR(255) NOT NULL,
  state               VARCHAR(15)   NOT NULL,
  deliver             TINYINT       NOT NULL,
  digest              TINYINT       NOT NULL,
  digest_frequency    INT           NOT NULL,
  expire              CHAR(15)      NULL,
  includeBody         TINYINT       NOT NULL,
  showValues          VARCHAR(30)   NULL,
  subscriptionType    VARCHAR(10)   NOT NULL,
  subscriptionDepth   TINYINT       NOT NULL,
  keyword             VARCHAR(200)  NULL,
  PRIMARY KEY (serviceID, nodeID, id)
);

CREATE TABLE ofPubsubDefaultConf (
  serviceID           VARCHAR(100)  NOT NULL,
  leaf                TINYINT       NOT NULL,
  deliverPayloads     TINYINT       NOT NULL,
  maxPayloadSize      INTEGER       NOT NULL,
  persistItems        TINYINT       NOT NULL,
  maxItems            INTEGER       NOT NULL,
  notifyConfigChanges TINYINT       NOT NULL,
  notifyDelete        TINYINT       NOT NULL,
  notifyRetract       TINYINT       NOT NULL,
  presenceBased       TINYINT       NOT NULL,
  sendItemSubscribe   TINYINT       NOT NULL,
  publisherModel      VARCHAR(15)   NOT NULL,
  subscriptionEnabled TINYINT       NOT NULL,
  accessModel         VARCHAR(10)   NOT NULL,
  language            VARCHAR(255)  NULL,
  replyPolicy         VARCHAR(15)   NULL,
  associationPolicy   VARCHAR(15)   NOT NULL,
  maxLeafNodes        INTEGER       NOT NULL,
  PRIMARY KEY (serviceID, leaf)
);

# Finally, insert default table values.

INSERT INTO ofID (idType, id) VALUES (18, 1);
INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 21);

# Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
    VALUES ('admin', 'admin', 'Administrator', '[email protected]', '0', '0');

# Entry for default conference service
INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);
[root@bogon ~]# 

10.然后去创建表:

【已解决】CentOS中如何导入mysql的schema去创建数据库的表

11.然后就可以进入安装向导了:

【记录】在CentOS上安装和配置Openfire的过程

12.再去参考:

Centos下Openfire详细安装过程 – 陨落星空 – 51CTO技术博客

Linux下Openfire的安装和配置二、openfire安装配置-行脚僧-ChinaUnix博客

CentOS 7部署Openfire纪实 | Nocturne Studio

去下载:

用于聊天的软件,可以搭配作为聊天服务器的OpenFire的客户端软件Spark:

【记录】下载和安装并登陆即时通信客户端软件:Spark

注:

另外其他聊天软件还有:

jwchat

13.另外再去参考之前的帖子,新增加OpenFire相关的其他端口,包括9091等等。参考:

Diantokam: Installing OpenFire on CentOS 6.0 (64 Bit)

Openfire uses ports 5222, 7777, 9090, 9091 for client connections, file transfer proxy, http web administration and the secured administration respectively.

才知道,原来9091是https的,所以是:

https://localhost:9091

普通的是:

http://localhost:9090

去配置端口:

[root@bogon ~]# iptables -A INPUT -p tcp -i eth0 --dport 5222 -j ACCEPT
[root@bogon ~]# iptables -A INPUT -p udp -i eth0 --dport 5222 -j ACCEPT
[root@bogon ~]# iptables -A INPUT -p tcp -i eth0 --dport 7777 -j ACCEPT
[root@bogon ~]# iptables -A INPUT -p udp -i eth0 --dport 7777 -j ACCEPT
[root@bogon ~]# iptables -A INPUT -p tcp -i eth0 --dport 9090 -j ACCEPT
[root@bogon ~]# iptables -A INPUT -p udp -i eth0 --dport 9090 -j ACCEPT
[root@bogon ~]# iptables -A INPUT -p tcp -i eth0 --dport 9091 -j ACCEPT
[root@bogon ~]# iptables -A INPUT -p udp -i eth0 --dport 9091 -j ACCEPT
[root@bogon ~]# iptables save
Bad argument `save'
Try `iptables -h' or 'iptables --help' for more information.
[root@bogon ~]# /etc/rc.d/init.d/iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]
[root@bogon ~]# /etc/init.d/iptables restart
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]
[root@bogon ~]# 

14.继续去配置OpenFire。

参考:

Openfire: Custom Database Integration Guide

把新的jdbcProvider添加到jive下面:

<jdbcProvider>
    <driver>com.mysql.jdbc.Driver</driver>  
    <connectionString>jdbc:mysql://localhost:3306/xxx?user=root&amp;password=root</connectionString>
  </jdbcProvider>  
  <provider>
    <auth>
      <className>org.jivesoftware.openfire.auth.JDBCAuthProvider</className>
    </auth>  
    <user>
      <className>org.jivesoftware.openfire.user.JDBCUserProvider</className>
    </user>  
    <group>
      <className>org.jivesoftware.openfire.group.JDBCGroupProvider</className>
    </group>
  </provider>  
  <jdbcAuthProvider>
    <passwordSQL>select password from UserSecurity where userId=?</passwordSQL>  
    <passwordType>plain</passwordType>
  </jdbcAuthProvider>  
  <jdbcUserProvider>
    <loadUserSQL>SELECT t1.username as name, t2.email as email FROM UserBase t1, UserSecurity t2 userId=?</loadUserSQL>  
    <userCountSQL>SELECT COUNT(*) FROM UserSecurity</userCountSQL>  
    <allUsersSQL>select userId as username from UserSecurity</allUsersSQL>  
    <searchSQL>SELECT userId as username FROM UserSecurity WHERE</searchSQL> 
    <usernameField>username</usernameField>  
    <nameField>name</nameField>  
    <emailField>email</emailField>
  </jdbcUserProvider>  
  <jdbcGroupProvider>
    <groupCountSQL>SELECT count(*) FROM GroupInfo</groupCountSQL>  
    <allGroupsSQL>SELECT groupId as groupName FROM GroupInfo</allGroupsSQL>
    <userGroupsSQL>SELECT groupId as groupName FROM GroupUser WHERE userId=?</userGroupsSQL>  
    <descriptionSQL>SELECT groupName as groupDescription FROM GroupInfo WHERE groupId=?</descriptionSQL>  
    <loadMembersSQL>SELECT userId as username FROM GroupUser WHERE groupId=? AND isAdmin='N'</loadMembersSQL>  
    <loadAdminsSQL>SELECT userId as username FROM GroupUser WHERE groupId=? AND isAdmin='Y'</loadAdminsSQL>
  </jdbcGroupProvider>  

jive add jdbcProvider note configuration

 

再去启动OpenFire:

[root@bogon ~]# service openfire start
Starting openfire: 
[root@bogon ~]# service openfire status
openfire is running
[root@bogon ~]# 

15.对于OpenFire用到的端口,后来可以看到登陆进入的主界面中有列出来:

服务器端口

接口

端口

 

类型

描述

0:0:0:0:0:0:0:0

5222

加密

客户端到服务器

客户端使用标准端口连接到服务器,连接可能没有加密,您可以更新安全设置 为这个端口

0:0:0:0:0:0:0:0

5223

加密

客户端到服务器

客户端使用旧的SSL方法连接到服务器的端口。旧的SSL方法不是一个XMPP标准方法,在不久将不被支持,您可以更新安全设置 为这个端口

所有的地址

9090

 

管理控制台

端口使用不安全的管理控制台访问.

所有的地址

9091

加密

管理控制台

端口使用安全的管理控制台访问.

所有的地址

7777

 

文件传送代理服务器

代理服务使用的端口允许在XMPP网络上的两个实体使用文件传送

所有的地址

7070

 

HTTP绑定

使用不安全的HTTP客户端连接端口

所有的地址

7443

加密

HTTP绑定

使用安全的HTTP客户端连接端口

所有的地址

5229

 

Flash跨域

允许Flash客户端连接到其他主机名和端口。

 

16.对于已安装好的Openfire,去看看后台的界面:

服务器配置:

openfire admin page server setting

 

系统属性:

openfire admin page system properties

 

特性设置:

openfire admin page features setttings

 

Media Proxy:

openfire admin page media proxy

 

用户摘要:

openfire admin page user summary

 

客户端会话:

openfire admin page client session

 

分组聊天房间:

openfire admin page muc room summary

 

插件:

openfire admin page plugin

 

【总结】

去官网下载Openfire,按照向导一步步操作,即可安装。

然后再去装个聊天软件客户端Spark,即可聊天。

转载请注明:在路上 » 【记录】在CentOS 6.6中安装OpenFire

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.252 seconds, using 22.16MB memory