Openfire_logosoftware-spark

 

INTRODUCTION:

Extensible Messaging and Presence Protocol (XMPP) is a communications protocol for message-oriented middleware based on XML (Extensible Markup Language). The protocol was originally named Jabber and was developed by the Jabber open-source community in 1999 for near real-time, instant messaging (IM), presence information, and contact list maintenance. Designed to be extensible, the protocol has also been used for publish-subscribe systems, signalling for VoIP, video, file transfer, gaming, Internet of Things applications such as the smart grid, and social networking services.

 

Unlike most instant messaging protocols, XMPP is defined in an open standard and uses an open systems approach of development and application, by which anyone may implement an XMPP service and interoperate with other organizations’ implementations. Because XMPP is an open protocol, implementations can be developed using any software license; although many server, client, and library implementations are distributed as free and open-source software, numerous freeware and commercial software implementations also exist.

 

 

OPENFIRE:

Openfire (previously known as Wildfire, and Jive Messenger) is an instant messaging (IM) and groupchat server that uses XMPP server written in Java.

 

According to igniterealtime.org, Openfire is a real time collaboration (RTC) server licensed under the Open Source GPL. It uses the only widely adopted open protocol for instant messaging, XMPP (also called Jabber). Openfire offers rock-solid security and performance.

 

Openfire supports the following features:

  • Web-based administration panel
  • Plugin interface
  • Customizable
  • SSL/TLS support[2]
  • User-friendly web interface and guided installation
  • Database connectivity (i.e. embedded Apache Derby or other DBMS with JDBC 3 driver) for storing messages and user details
  • LDAP connectivity
  • Platform independent, pure Java
  • Full integration with Spark IM client
  • The proprietary extension to Openfire allows multiple server instances to work together in one clustered environment

So you want to set up your own private chat network for friends or family, or maybe your company uses the major chat providers like AIM, Yahoo, MSN, or Google for interoffice communication, but you want more control and to keep the network traffic inside your LAN. Whatever your case may be, this guide will show you how to do it with Ignite Realtime’s Openfire Jabber Server for Centos 6.

 

 

INSTALLATION:

 

Befor installing Openfire ,we have to complete two  preliminary steps. Those two steps are setting up a DNS alias for the server host name and creating a MySQL database for the backend instead of using the included embedded database.

 

Create a DNS Host Name for your Openfire Server

For this guide I’ll use the host name ‘server’ for my Openfire server. I run my own DNS server so I’ll be editing my zone file to add the new alias. If you use a third party service for DNS on your domain then you should know how to add new aliases.

 

Open your zone file in a text editor and add your new alias. Yours may look something like this example when you’re done. The highlighted line is what I added.

 

$TTL 86401

@ IN SOA  ns.sixthstartech.com. root.sixthstartech.com. (
42 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns.sixthstartech.com.
IN A 10.0.0.100
ns.sixthstartech.com IN A 10.0.0.100
server IN A 10.0.0.100
server.sixthstartech.com IN A 10.0.0.100

 

For further reference how to create  DNS  view my previous post https://sathisharthars.wordpress.com/2013/05/25/configuring-mail-server-postfixdovecotsquirrelmail-with-ssltls-support/.

 

# service named restart

# yum install java libldb.i686 mysql-server mysql-connector-java

திரைபிடிப்பு 2013-09-24 11_05_15

 

 

Create the MySQL Database for Openfire Data

Sometimes a tool like phpMyAdmin comes in handy for managing MySQL databases, however I don’t have it installed on this server. Instead I’ll be adding my Openfire database from the MySQL console. All we need to do is create the database, add an user account that has full control over that database, and reload (flush) the privileges.

# mysql -u root -p

# mysql> CREATE DATABASE openfire;

# mysql> GRANT USAGE ON *.* TO ‘root’@’localhost’ IDENTIFIED BY ‘Sixth$123’;

# mysql> FLUSH PRIVILEGES;

# mysql> quit;

# chkconfig –level 235 mysqld on

 

திரைபிடிப்பு 2013-09-24 12_12_06

 

 

Openfire can be downloaded from the Ignite Realtime web site, We’ll start by downloading the Openfire RPM via wget.

# wget http://download.igniterealtime.org/openfire/openfire-3.8.1-1.i386.rpm

 

திரைபிடிப்பு 2013-09-24 11_09_55

 

# rpm -ivh openfire-3.8.1-1.i386.rpm

 

திரைபிடிப்பு 2013-09-24 11_11_04

 

# service openfire start

# chkconfig –level 235 openfire on

 

Open Ports in your Firewall

If you have a firewall in place you’ll need to open some ports before we can start configuring Openfire through its web interface. Openfire uses ports 5222, 7777, 9090, 9091 for client connections, file transfer proxy, http web administration and the secured administration respectively. If you use iptables tables like I do, add these lines to your/etc/sysconfig/iptables rules file and reload.

 

# vi /et/sysconfig/iptables

-A INPUT -p tcp -i eth0 –dport 5222 -j ACCEPT

-A INPUT -p udp -i eth0 –dport 5222 -j ACCEPT

-A INPUT -p tcp -i eth0 –dport 7777 -j ACCEPT

-A INPUT -p udp -i eth0 –dport 7777 -j ACCEPT

-A INPUT -p tcp -i eth0 –dport 9090 -j ACCEPT

-A INPUT -p udp -i eth0 –dport 9090 -j ACCEPT

-A INPUT -p tcp -i eth0 –dport 9091 -j ACCEPT

-A INPUT -p udp -i eth0 –dport 9091 -j ACCEPT

Then reload iptables to accept the new directives.

# iptables-restore < /etc/sysconfig/iptables

 

 

Configure Openfire through its Web Interface

Launch your favorite browser and go to http://yourserver_ip_address:9090 or if you set up a DNS alias http://server.mydomain.com:9090 to go to the Openfire web interface. You’ll be greeted by Openfire’s setup tool. In the first step, select your language. Here we choose English.

திரைபிடிப்பு 2013-09-24 11_17_49

 

 

The next step is to set the server domain. If you opted for an IP address name, enter your server’s IP. If you opted to create a DNS alias, enter the DNS server domain. Here we created server.sixthstartech.com so we’ll enter that. By default the Openfire web interface console ports are 9090 and 9091 for standard and secure respectively

திரைபிடிப்பு 2013-09-24 11_18_02

 

 

You have two choices regarding which database to use for Openfire to store its data: an external database like MySQL, MSSQL, PostgreSQL, etc… or to use the bundled embedded database. If you setup a MySQL database like we did in this guide then select the Standard Database Connection option. If you didn’t, the only choice is to use the Embedded Database.

திரைபிடிப்பு 2013-09-24 11_18_29

 

 

To set up your database connection, select the appropriate driver from the Database Driver Presets list (we set up a MySQL database so we’ll select MySQL). The page will refresh and you need to fill in the necessary information (the database host, name, username, and password). You should have this information from when you setup your MySQL database. Per this guide, MySQL is on the same server as my Openfire installation (localhost) and I created a database called ‘openfire’ with a username of ‘root’ and set a password.

திரைபிடிப்பு 2013-09-24 12_19_46

 

 

The profile step has to do with the users and groups of chat members and where Openfire will store that information (new users, user groups, etc…). We won’t opt for LDAP to store this information. It is much more convenient to save it in our in our database.

Screenshot-2

 

 

Enter the administrator email address (your email address) and set a password for your Openfire server.

Screenshot-3

 

 

Click the Login to admin console button.

Screenshot-4

 

 

Type in the Openfire admin password you entered in Step 6 and click the Login button.

திரைபிடிப்பு 2013-09-24 12_23_08

திரைபிடிப்பு 2013-09-24 12_28_04

 

 

 

Creating Users.

 

Go to Create New User under the Users section on the left. Fill in the Username,Password, and Confirm Password fields and click the Create User button.

திரைபிடிப்பு 2013-09-24 12_32_23

 

 

Repeat this process to add all the users you want on your server.

திரைபிடிப்பு 2013-09-24 12_33_31

 

 

 

Setting up a Jabber Client (Spark 2.5.8 for Windows)

Download Spark, install it, and launch it.

Type in your Openfire user credentials (Username and Password). In the Serverfield, type in the Openfire Servers IP address or DNS alias. Click the Login button.

 

 

Now i install spark in two machines, one is ubuntu and other one is windows and i logged in to the spark with separate accounts sathish and sam which i created in the centos server.

Untitleds

திரைபிடிப்பு 2013-09-24 12_44_37g

 

 

 

Now i send a request to the user sathish in ubuntu machine from the user sam in windows machine.

 

 

Image 3

 

திரைபிடிப்பு 2013-09-24 13_14_23s

Image 4c

 

Now  i started chatting with user sathish from the user sam.

 

Image 6

திரைபிடிப்பு 2013-09-24 13_16_12

திரைபிடிப்பு 2013-09-24 13_16_33

Image 7

 

I  want  other servers to be able to communicate with my server like AIM, Yahoo, MSN, or Google. we need to install plugins and enabling this functions in the system properties.

 

திரைபிடிப்பு 2013-09-24 13_18_16 திரைபிடிப்பு 2013-09-24 13_18_37

 

 

For communicate with server like facebook, yahoo,gtalk,etc. we need to install Kraken IM Gateway plugin, but I installed all the plugins and enabled this functions in the  system properties.

திரைபிடிப்பு 2013-09-24 13_21_58

 

 

I enabled all the gateway server like Facebook, Aol,Gtalk,Yahoo,etc in the system properties

 

திரைபிடிப்பு 2013-09-24 13_22_47

 

And enabled the server to server connection ports.

திரைபிடிப்பு 2013-09-24 13_23_49 திரைபிடிப்பு 2013-09-24 13_23_59

Now this server can communicate with any other  chat providers servers.