Wednesday, July 20, 2011

[Servers] Setup and provide basic Chat Server using Openfire

Hi Friends,
Openfire is an opensource, cross-platform chat server which uses XMPP (also called Jabber). It has a very simple installation procedure, easy to use web based Admin panel. In this post I will install openfire on Windows, configure it with LDAP, Use it with Web Chat Client Spark and Desktop Client Pidgin.

Openfire can be downloaded from http://www.igniterealtime.org/projects/openfire/ in form of executables containing JRE and just archives. Download and extract archive to a directory lets say D:/pFiles/openfire.


All the required documentation is available in documentation directory. To complete installation we need to setup
  1. Database
  2. LDAP Server (optional, but recommended)
For the database use one of these supported databases
  • MySQL
  • Oracle
  • Microsoft SQLServer
  • PostgreSQL
  • IBM DB2
  • HSQLDB
After database server installation create a database lets say openfire.
And for LDAP, please refer this post to setup OpenDS. Any LDAP can be installed and used.
Now when we have LDAP and Database ready, we are ready to setup Openfire.
Go to bin directory and run openfire.exe It will show that server is running and the address:port where admin console is running.














Now open browser and go to the link provided.. in this case http://127.0.0.1:9090 which will open the web-setup




Select the language and continue..


Select the server settings for our Openfire chat server.. provide the domain name which you want to choose. This domain will be used while login... for user ravi it ravi@rkg.test will be the login username.


We have an option to choose embedded database or use our own database server. Lets go for Standard connection.


Provide the correct details in the form and continue..


We can here select where we want to store the users data. I recommend LDAP since every organization has one LDAP and the same can be integrated and used easily. Remember that.. Users and groups are stored in the directory and treated as read-only. We can not modify anything using Admin console here.

Press continue to get form to fill the LDAP credentials and other details.





























We can also test connection settings using Test Settings Button.



Press Save and Continue to see user mappings. Change according to the LDAP you have. For my system I took all default so no need to change anything.


Same is the case for Group settings..


After filling all correct settings press Save and Continue. Next we should add one admin account to manage admin console. Add a user in next screen



If we add admin it will search and show users present in ldap as well.



Select user if present and then continue. Now login to the admin console using the link http://127.0.0.1:9090/index.jsp or whatever is applicable for your system.


Now the server is running and up. We can configure any client to connect to server and chat with other users. Popular desktop clients which can be used are Pidgin, trillian, empathy etc. For web client we can use SparkWeb.
Below are the steps to add account in pidgin. Click on Manage Accounts in Account in Menu.














Now add one more account..




















The account type will be xmpp. Fill correct username and password. If needed put domain as we provided earlier.. in this case it is rkg.test.


















We need to modify the advance settings as well



















Now after adding we can chat to other users on the server. Next few screens will show the sparkweb client which can be put in any webserver like apache and used using browser. In my case I have put it in a folder called chat and accessing with url http://rkg.test:4000/chat/SparkWeb.html. This is a flash based client which can be used on web and connects to the server we want.






















Thats it for the Chat Server and Clients.. We have one chat server running now, one Desktop client configured, one web client configured.

Cheers!!!

Ravi Kumar Gupta

5 comments:

  1. Why not use the Spark desktop client instead of the webclient or Pigin?

    ReplyDelete
  2. Any client can be used, I am used to of Pidgin and have been using since many years. Also I had pidgin installed on system so it was easy to put screenshots of that.. :)

    ReplyDelete
  3. Als Mitarbeiter von Dell denke ich, dass Ihre Erklärung wirklich sehr behilflich sein kann. Während der Server Einrichtung können viele Probleme entstehen. Ich danke Ihnen für Verständnis dazu.

    ReplyDelete
  4. I use SparkWeb client,but I am confuse to give which server name ? ,I have add openfire server name i.e my pc name but not succeed,plkease give me solution

    ReplyDelete
    Replies
    1. In the image here http://3.bp.blogspot.com/-nxql_vF3Wk4/TibY2F7WkLI/AAAAAAAABs0/bgWZyHrIX_s/s640/run1.JPG you will be able to see server name.. use that.

      Delete

Note: Only a member of this blog may post a comment.