We have been roaming here and there to find a way to implement a chat application on our own network. Finally, figured out a way to implement the same on our network. The solutions which we described below can be used over the internet and it can be used within the network/intranet.
- Linux Machine – Would be good if its Centos. Personally, I love to play with Centos server 😛
- Mysql Server – Any version would be fine. Though, latest version 5.6 would be good which is latest at time of this post(Sep 2016)
- Open ports – 9090, 5222,5223,5269.
Chat Application (Server Side) – Openfire:
We will be using openfire application on the server. Let’s install the openfire application on the server.
Download the application on to the server. At the time of the post, the latest version of openfire is 4.0.3.
Install the application using rpm.
rpm -ivh openfire-4.0.3-1.i386.rpm
Now, its time to create a database. This post assumes that mysql is already installed. Incase, if mysql is not installed, install mysql on the server. There are various articles available and we have also dealt the mysql installation on our various posts.
Access mysql prompt and create the database and user.
create database openfire;
grant all privileges on openfire.* to <dbusername>@'localhost' identified by '<dbpassword>';
Start the openfire application.
chkconfig openfire start
Incase if the application failed to start, check the file /opt/openfire/logs/nohub.out. If you get any error related with java(may be sometime issue with OS version/java compatibility). Remove the openfire installed java version and create a symlink to system installed java.
mv java java.bak
ln -s /usr/bin/java java
Now, we have completed the setup on server side.
Its time to complete the openfire setup. Access the IP address in the browser.
Select the language as English and Click on Proceed.
Enter the Server Settings as per your requirement. If you follow the document, please give the follow details.
Admin Console Port:9090
Server Admin Console Port:9091
Select the Driver as Mysql and modify connection URL with the database details which you created.
Mention the DB username and DB password.
Setup Administrator account.
Admin Email Address:<firstname.lastname@example.org>
You are done 🙂 Complete the setup.
So, far we have completed the openfire setup. Now, we will create a user and configure user on client side.
Access the openfire on the browser
Move the pointer to Users/Groups > Create User
Enter the User details.
Click on Create User
Lot of articles suggested to go with spark client which may be compatible with openfire. However, we are not comfortable with spark client and there are multiple issues which we are facing with spark client. So, we decided to go with Pidgin instance messanger.
Depends on the client machine, the pidgin can be installed on most of the OS. In this article, we are gonna explain on how to configure pidgin on windows machine.
Download the pidgin from pidgin official website.
Click on the installer and complete the installation.
Open pidgin and move the pointer Accounts > Manage Accounts
Click on Add and mention the follow details.
Username:<your name which you created>
Domain:IP address or Domain name of the server
Click on Add to complete the installation.
Welcome to the chat world 🙂 🙂 🙂