Saturday, November 21, 2009

Installing OpenFire IM Server on Debian 5

It has been a long while since my last post, but I am back and will try to make it more of a commitment now to update my blog. During the time I was away, I used some of my time to start exploring Linux. It is not a secret that Open Source GNU/LINUX is making a lot of headway now and I must say that as a beginner in Linux, something tells me that I will be starting to use it more and more.

There are several variants of LINUX and I don't want to go about its history. I had to select a distribution to start playing around with and searching around led me to Debian which is one of the more stable and supported distributions out there. (I guess I don't need to mention its free!)

On the topic of OpenSource software, my need to learn LINUX I must admit embarrassingly was more of a necessity than desire. One of the best known OpenSource softwares out there is OpenFire, it is a jabber Instant Messaging Server with provisions for a lot of cool plugins that can give Office Communications Server a good run for its money. I had the need to implement this on my workplace which has brought me back here to my blog after a long hiatus.

Setting up Debian is no different from any Operating System Installations out there, you boot from the CD (you can also setup a network installation source by the way), follow the install prompts and hit next-next-next. It is good to understand Linux's partitioning system but for me as a beginner I just go with LVM and keep the suggested partition scheme during installation.

I don't have a lot of screenshots during my debian install and setup. But I will be detailing most of the post install tasks i have done to setup my Debian system for installing OpenFire. When i started setting up Debian, I have heard a lot of good comments on Debian's application packaging system and I must say that this is the part i had most fun. Basically you start of with the Base OS system just like if you are used to Windows Server Operating Systems, then you can add and remove roles or features thru your Debian's application packaging system.

To setup your OpenFire IM Server on Debian, you will be having an outline of tasks as similar below:

1) Install Debian 5 aka "Lenny" Server (latest version is 5.0.3 during the time of my post)
2) Install package openssh-server (needed for terminal management)
3) Update your /etc/apt/sources.list to add some mirrors to get the install package for sun-java6-jre (this is required by Openfire java version was latest that i used for the time being)
4) Install mysql-server (I went OpenSource all the way, so I decided to to use MySQL although you can use Openfire's embedded database)
5) Create your Openfire Database on MySQL
6) Install the Openfire package via dpkg - (downloadable from ingniterealtime website the file will end with a .deb extension)
7) Import the schema file from the
resources/database of your Openfire installation directory
8) Fire up the Openfire setup wizard (screenshots will be shown later)

If you follow this outline, you will be able to setup your own Openfire IM server ready for use in your environment.

You can use the repository mirrors (basically sources of updates and application packages for Debian) below and edit your sources.list to add the non free repositories to obtain the sun-java6-jre package.

deb http://ftp.us.debian.org/debian/ lenny main contrib non-free
deb-src http://ftp.us.debian.org/debian/ lenny main
deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main
deb http://volatile.debian.org/debian-volatile lenny/volatile main
deb-src http://volatile.debian.org/debian-volatile lenny/volatile main


You need to issue an apt-get update command after modifying your sources.list file. After that you can do an apt-cache search sun-java6-jre to search for the package on the repositories. You can also issue an apt-cache show sun-java6-jre to get details on the package before installing. Once you sure you have the right app package you can issue apt-get install sun-java6-jre to install the package. This is the part where I had the most fun, installing the packages after the base OS installation. This is where a lot of buzz on Debian are about. They have a great packaging system and installing those packages is a lot of fun.


A sample screenshot of my installation of MySQL is shown below. Basically installing sun-java6-jre will be similar.




After installing the prerequisites, create the openfire database by issuing the command mysql –u root –p create database databasename; the –u specifies the mysql root account and –p prompts for the password which you will be asked during your installation of mysql.


You can install the openfire application you have downloaded from the igniterealtime site. The latest version during the time of this blog is 3.6.4. You can run the command dpkg –i openfire_3.6.4_all.deb to install openfire. You will be expecting to a couple of warnings during the install and you can follow the community thread here to http://www.igniterealtime.org/community/thread/38487 to check on both warnings. On a personal note, the server I setup seemed to run fine even with this warning prompts during install.


After installing ensure to import the mysql schema before you invoke the Openfire setup wizard. You can issue the command cat openfire_mysql.sql | mysql –u root – p [databaseName];

Once done, fire up a browser and connect to your Openfire server on port 9090 and follow the install prompts. Couple of screenshots shown below.




After completing the setup download your jabber client such as Spark and connect to your openfire server to start using your IM server.