How to Setup Chat Server Using Openfire 3.7.1 in Ubuntu Server 12.10

in Chat Server, How To

This guide shown you how to build chat server using Openfire 3.7.1 in ubuntu server 12.10. Openfire is a free and open source real-time collaboration (RTC) instant messaging server. It uses the only widely adopted open protocol for instant messaging, XMPP (also called Jabber). Openfire is incredibly easy to install and configure, but offers rock-solid security and performance. Openfire licensed under the Open Source Apache License.

In additonal, openfire also available for major platform ( windows, Mac OS and Linux). Follow the step-by-step to install and configure chat/IM server using Openfire 3.7.1 on ubuntu server edition

Step-by-Step to Installing and Configure Chat/IM Server using Openfire

Step 1. Login using SSH or Login Directly into ubuntu server 12.10. Before installing Openfire server, make sure your system is up to date. Enter the following commands, one by one, and install any available updates:

sudo apt-get update
sudo apt-get upgrade

Step 2.  Install latest version of Oracle JRE/JDK, use personal package archieve (PPA) WEBUPD8 to install it.

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

If you are using OpenJDK, remove it to minimise any Java conflicts

sudo apt-get remove --purge openjdk*

Then install Oracle Java 7 version with following command

sudo apt-get install oracle-java7-installer

Step 3. Install MySql Database server

Install latest version MySQL server using apt-get

sudo apt-get install mysql-server

Step 4Create new MySQL database for Openfire

Log in to MySQL Server as root.

sudo mysql -u root p

Create the database “dbopenfire”, add new user “openfire” and add new password “openfirepwd” for user “openfire”.

mysql> CREATE DATABASE dbopenfire CHARACTER SET='utf8';
mysql> CREATE USER 'openfire'@'localhost' IDENTIFIED BY 'openfirepwd';
mysql> GRANT ALL PRIVILEGES ON dbopenfire.* TO openfire@localhost WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> quit

Step 5. Download and Install openfire 3.7.1

Download deb. package of Openfire 3.7.1 from ignite realtime download page

cd /tmp
wget http://download.igniterealtime.org/openfire/openfire_3.7.1_all.deb

Install openfire_3.7.1_all.deb with dpkg command:

sudo dpkg -i openfire_3.7.1_all.deb
(Reading database ... 85791 files and directories currently installed.)
Preparing to replace openfire 3.6.4 (using openfire_3.7.1_all.deb) ...
Unpacking replacement openfire ...
Setting up openfire (3.7.1) ...
Installing new version of config file /etc/openfire/security/truststore ...
Installing new version of config file /etc/init.d/openfire ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot

Ignore all installation errors regarding user and folder permissions.it cause depending on your version of JRE/JDK, Now you need to editing file /etc/init/d/openfire in line 27. Replace java-6-sun with java-6-oracle or java-7-oracle.

sudo apt-get install rpl
sudo rpl '6-sun' '7-oracle' /etc/init.d/openfire
sudo service openfire start

Step 6.  Allow ports for Openfire

You need to setup firewall and allow some ports for openfire on ubuntu server, use ufw command to set firewall openfire

sudo ufw allow 9090/tcp
sudo ufw allow 9091/tcp
sudo ufw allow 5222/tcp
sudo ufw allow 7777/tcp
sudo ufw allow 7443/tcp
sudo ufw allow 7070/tcp
sudo ufw allow 3478/tcp
sudo ufw allow 3479/tcp

This completes the initial installation steps for Openfire. Next, we’ll continue with configuration through a web browser

Step 7.  Configuring Openfire Server

Configuring Openfire is very easy and can be completed in just a couple of steps. Here’s how to configure Openfire:

From computer in your network open your favorite browser  and go to :

http://mydomain:9090/setup/index.jsp

Replace mydomain above with your FQDN or IP address of your ubuntu server. The webpage shown below appears:

Step 8. Download and Install IM client for Linux, Windows and Mac OSX

You need to download install IM/VOIP client software on all PC/Laptop  to connect with the Openfire server. You can install any IM client that uses the XMPP/Jabber protocol for example the excellent Pidgin, it available for Linux Ubuntu, Windows, and Mac OSX.  for Ubuntu users pidgin can be installed from the Ubuntu Software Center.

sudo apt-get install pidgin

If you have done install pidgin,Make sure that you select XMPP

The native cross plaform client for Openfire is Spark, it also available for Linux, Windows and Mac OSX. Download spark from Igniterealtime Download Page, and install it on ubuntu desktop edition (Ubuntu 11.04, Ubuntu 11.10, ubuntu 12.04 and Ubuntu 12.10)

wget http://download.igniterealtime.org/spark/spark_2_6_3.tar.gz
tar -zxvf spark_2_6_3.tar.gz
sudo mkdir /opt/spark
sudo mv Spark/* /opt/spark/

Create a desktop launcher file, Open terminal and run following command

sudo nano /usr/share/applications/spark.desktop

[Desktop Entry]
Name=Spark
Version=2.6.3
GenericName=Spark
X-GNOME-FullName=Spark
Comment=ignite realtime Spark IM client
Type=Application
Categories=Application;Utility;
Path=/opt/spark
Exec=/bin/bash Spark
Terminal=false
StartupNotify=true
Icon=/opt/spark/logo-spark.png
TargetEnvironment=Unity
sudo cd /opt/spark
sudo wget https://dl.dropbox.com/u/50880014/spark.png

Now, You will then be able to search for Spark in you unity dash and launch Spark.

spark ubuntu 12.10 How to Setup Chat Server Using Openfire 3.7.1 in Ubuntu Server 12.10

Link Reference :

Advertisement:
  • cpasenau

    great manual!

    If you have trouble with java cache try this:

    1) Added system property — cache.username2roster.maxLifetime = 419430400

    2) Added system property — xmpp.pep.enabled = false

  • gmiller

    Just a typo in step 4 – sudo mysql -u root p should be: sudo mysql -u root -p (you need a dash “-” in front of the p to prompt for the password – otherwise, fantastic!

  • techuser6

    I am getting “The program ‘add-apt-repository’ can be found in the following packages:
    * python software properties
    * software-properties-common
    Try: apt-get install

    Using Ubuntu 12.10 server running as root ???

    • techuser6

      The trick was an extra step…BEFORE the add-apt-repository command…

      sudo apt-get install software-properties-common

      This will allow you to run the add-apt-repository command…from a fresh Ubuntu Server installation.

Previous post:

Next post: