Deploying OpenFire for IM (instant message) service (TCP/IP service) with database MySQL , client Spark on linux部署OpenFire IM 消息中间件服务

时间:2023-03-09 14:46:47
Deploying OpenFire for IM (instant message) service (TCP/IP service) with database MySQL , client Spark on linux部署OpenFire IM 消息中间件服务

Are you a hacker?

How to build another QQ/Wechat/whatsapp/skype/imessage?

Let's go through this!!!!

Materials:

A linux/unix/windows/mac computer/server, and do some basic things!

Are you feeling high?

  Okay, let's ride the rocket!

Get materials:

1. A search engine

duckduckgo.com to search 'openfire'

2. Service software

'OpenFire' from here http://www.igniterealtime.org/downloads/index.jsp

and the client software spark: 'Spark'             ( here for example: download the http://www.igniterealtime.org/downloads/download-landing.jsp?file=openfire/openfire_3.9.3_all.deb , because i deployed it on a debian/ubuntu machine )

3. Packages installation

# for some situations, some other packages such as openjdk--jre should be installed or other packages
sudo apt-get install apache2 openjdk--jre mysql-server mysql-client -y
# then
sudo dpkg -i /path/to/openfire_3..3_all.deb

4. Database settings

mysql -uroot -p
# then create a database in the mysql console
mysql> create database openfire;

5. Service Deployment

Go to the web page:

xx.xx.xx.xx:9090

then you will see some references guiding you to install. ( choose the outer base database , not the default database. Here MySQL preferred)

next and next => then finish.

6. Plugin installation: Monitoring Service

Go to the web page:

xx.xx.xx.xx:9090

Deploying OpenFire for IM (instant message) service (TCP/IP service) with database MySQL , client Spark on linux部署OpenFire IM 消息中间件服务

click on the green 'cross' button  on the right.

Deploying OpenFire for IM (instant message) service (TCP/IP service) with database MySQL , client Spark on linux部署OpenFire IM 消息中间件服务

7. Plugin Settings

Deploying OpenFire for IM (instant message) service (TCP/IP service) with database MySQL , client Spark on linux部署OpenFire IM 消息中间件服务

toggle the "Archive one-to-one chats" and/or "Archive group chats"

8. Have an instant conversation

(P.S. you will need to add some one before the conversation one-to-one, of course)

In this case, create a user here:

Deploying OpenFire for IM (instant message) service (TCP/IP service) with database MySQL , client Spark on linux部署OpenFire IM 消息中间件服务

Then open the client software!!!

# start the client 'Spark'
sudo sh /path/to/Spark/resources/startup.sh &

Then you will see the user interface as this:

Deploying OpenFire for IM (instant message) service (TCP/IP service) with database MySQL , client Spark on linux部署OpenFire IM 消息中间件服务

Login!!!

Do the same thing for another account . e.g. another account: 'admin'

Send messages between different clients

Deploying OpenFire for IM (instant message) service (TCP/IP service) with database MySQL , client Spark on linux部署OpenFire IM 消息中间件服务

From the page:   Server -> Archiving -> Search archive , we can see their talking record. WOW! What a conversation :P

9. Data tasting

We are not satisfied with that just reading some thing from web page.

Here feel what we got!

mysql -uroot -p
# input your password
mysql> use openfire;
mysql> select * from ofUser;
"something dumped out" mysql> select * from ofMessageArchive;
"other dumped out"

Notice : the table 'ofMessageArchive' is created because of the enabling of the plugin 'monitor archiving'

Let's see what we got!!

for user:

Deploying OpenFire for IM (instant message) service (TCP/IP service) with database MySQL , client Spark on linux部署OpenFire IM 消息中间件服务

for the conversation record (archived)

Deploying OpenFire for IM (instant message) service (TCP/IP service) with database MySQL , client Spark on linux部署OpenFire IM 消息中间件服务

Yeah! we see that!

"Next big" :

client A -> middleware -> client B

client B -> middleware -> client A

domestic server -> middleware -> client A

domestic server -> middleware -> client A, client B, client C, ...

client A  -> middleware -> domestic server

Happy hacking!