Install openfire on CentOS

Source: Internet
Author: User

Install openfire on CentOS

Openfire

Http://www.igniterealtime.org/downloads/

Apache-ant

Http://ant.apache.org/bindownload.cgi

Disable Firewall

/Etc/init. d/iptables stop

Update Beijing Time

/Usr/sbin/ntpdate ntp.sjtu.edu.cn

Install jdk

Tar zxvf jdk-7u71-linux-x64.tar.gz

Mkdir/usr/java

Mv jdk1.7.0 _ 71/usr/java/jdk1.7.0

Vi/etc/profile

Add the last line

# Java environment

Export JAVA_HOME =/usr/java/jdk1.7.0

Export CLASSPATH =.: $ JAVA_HOME/jre/lib: $ JAVA_HOME/lib/tools. jar

Export PATH = $ JAVA_HOME/bin: $ PATH

Source/etc/profile

View version

Java-version

Install ant

Mkdir/usr/ant

Tar zxvf apache-ant-1.9.5-bin.tar.gz-C/usr/ant/

Cd/usr/ant/

Mv apache-ant-1.9.5 ant1.9.5

Vi/etc/profile

Add the last line

# Ant environment

Export ANT_HOME =/usr/ant/ant1.9.5

Export PATH = $ ANT_HOME/bin: $ PATH

Source/etc/profile

View version

Ant-version

Install openfire

Rpm-ivh openfire-3.10.0-1.i386.rpm

Service openfire start

I have installed mysql 5.6

Edit the mysql configuration file and set the default encoding to utf8.

Vi/usr/local/mysql/my. cnf

[Mysqld]

Basedir =/usr/local/mysql

Data =/data/3306/data

Port = 3306

Server_id = 2

Socket =/data/3306/mysqld. sock

Pid-file =/usr/local/mysql. pid

Max_allowed_packet = 16 M

Log-bin = mysql-bin

SQL _mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES

Init_connect = 'set NAMES utf8'

Character-set-server = utf8

[Client]

Default-character-set = utf8

Restart Database

/Etc/init. d/mysqld restart

Enter Database

Mysql-u root-p

Run the following command to view the default character set:

Mysql> showvariables like 'character _ set _ % ';

+ -------------------------- + ---------------------------- +

| Variable_name | Value |

+ -------------------------- + ---------------------------- +

| Character_set_client | utf8 |

| Character_set_connection | utf8 |

| Character_set_database | utf8 |

| Character_set_filesystem | binary |

| Character_set_results | utf8 |

| Character_set_server | utf8 |

| Character_set_system | utf8 |

| Character_sets_dir |/usr/share/mysql/charsets/|

+ -------------------------- + ---------------------------- +

8 rows in set (0.00 sec)

Mysql> quit

Cd/opt/openfire/resources/database/

Cp-p openfire_mysql. SQL openfire_mysql. SQL .bak

Edit the SQL file to prevent Chinese users from garbled characters.

Vi openfire_mysql. SQL

Note that "default charset = utf8" is added to the end of each SQL statement for creating a table. This process is cumbersome and requires careful consideration.

For example:

Create table ofUser (

UsernameVARCHAR (64) not null,

PlainPassword VARCHAR (32 ),

EncryptedPasswordVARCHAR (255 ),

NameVARCHAR (0, 100 ),

Email VARCHAR (100 ),

CreationDateCHAR (15) not null,

ModificationDateCHAR (15) not null,

Primary key (username ),

INDEX ofUser_cDate_idx (creationDate)

) Defaultcharset = utf8;

The last part is as follows. The red field is added to support Chinese characters.

# Finally, insert default table values.

Set names gb2312;

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

Set names gb2312;

Insert into ofUser (username, plainPassword, name, email, creationDate, modificationDate)

VALUES ('admin', 'admin @ example.com ', '0', '0 ');

# Entry for default conference service

Set names gb2312;

Insert into ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference ', 0 );

Enter Database

Mysql-u root

Create Database openfire

Mysql> createdatabase openfire;

Query OK, 1 row affected (0.06 sec)

Mysql> use openfire;

Database changed

Import SQL files

Mysql> source/opt/openfire/resources/database/openfire_mysql. SQL;

Create an Administrator Account

Mysql> grant allon openfire. * to admin @ "%" identified by 'admin ';

Mysql> quit

Access openfire

Http: // 192.168.0.112: 9090/

Select Simplified Chinese

Select continue

Select standard database

Select mysql database and enter related data.

Pay special attention to the Database URL, which requires an error.

Select Initial Configuration

Enter relevant information

After the installation is complete, click to enter

The username is admin and the password is the new password.

The logon interface is as follows:

Run the installation program spark_2_7_0.exe on the client.

Click Next

Click Next

Click Next

Click Finish

Logon user admin

The status is as follows:

Then you can add a user to the server to log on to the client!


If you do not want to install the client

You can install a Web Client.

Tar zxvf sparkweb_0_9_0.tar.gz

Mv sparkweb/opt/

Publish with Nginx

Cd/usr/local/nginx/conf/vhosts/

Vi sparkweb. conf

Server {

Listen 80;

Server_name spark.xx.com;

Root/opt/sparkweb /;

Index SparkWeb.html index.html index.htm;

}

.../../Sbin/nginx-s reload

Web http://spark.xx.com/

Enter the user name, Server IP address, password, and click Login.

Search users

Select a user and add a user

Send offline messages

Log on to the test1 user and you will see the message.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.