Configuring ejabberd with jwchat

Jwchat is a full featured web based jabber client. Yesterday I tried to give a try for jwchat. Its simply awesome. These are the procedure for configuring ejabberd to make jwchat work. I am using kubuntu karmic kola as a test machine.

1)Download jwchat tar ball from here.

2) Install ejabberd( I used aptitude)

3)Create a directory ‘www’ in /var/lib/ejabberd/

4) Untar the jwchat to the /var/lib/ejabberd/www/

Give permission for the www directory as ejabberd

Now its time to configure the ejabberd and jwchat. Lets configure /etc/ejabberd/ejabberd.cfg first.

1) Uncomment the “override_acls.”

2) Since I am testing it in my machine I wouldn’t like to change Hostname part. I would like to keep it as localhost.

3) To my knowledge jwchat works with http-poll and http-bind. Hence we need to configure the port to which jwchat should listen to http-bind/http-poll.

{listen,

{5280, ejabberd_http, [
{request_handlers, [
{["web"],mod_http_fileserver}
]},
http_poll,
http_bind,
web_admin

]}

4) In the modules section of the ejabberd.cfg  add the following lines:

{mod_http_bind, []},

{mod_http_fileserver, [
{docroot,"/var/lib/ejabberd/www"},
{accesslog,"/var/log/ejabberd/webaccess.log"}
]},

I had added these lines at the start of the modules section, hence you may notice the trailing comma for the mod_http_fileserver. If you are adding it to the end of the modules section remove the trailing comma.

The ejabberd acts as a small webserver too. Hence you don’t have to install apache.

I forgot to tell you the version of ejabberd I am using. Its 2.0.1. After surfing a little in the internet I had found lot of users raised issues against ejabberd. And develepors are fixing it. Its good for a healthy project. Right?

5) Please do restart ejabberd: /etc/init.d/ejabberd restart

6) Test whether the port is open by: ‘telnet localhost 5280′ or by ‘netstat -anp | grep 5280′. If its open everything is fine.

5) Lets configure to jwchat’s config.js(/var/lib/ejabberd/www/jwchat/)

var SITENAME = “localhost”;

As I mentioned I am using localhost, I would like to go ahead with it. If you are trying to use any different domain. Please mention it here.  For eg:

var SITENAME = “jabber.example.com”

The BACKENDS section takes care of http-poll,http-bind and others.

Hence I have,

var BACKENDS =
[
{
name:"Native Binding",
description:"Ejabberd's native HTTP Binding backend",
httpbase:"/http-bind/",
type:"binding",
servers_allowed:[SITENAME]
},
{
name:”Native Polling”,
description:”Ejabberd’s native HTTP Polling backend”,
httpbase:”/http-poll/”,
type:”polling”,
servers_allowed:[SITENAME]
}

];

You had configured the ejabberd + jwchat. Now open :

http://localhost:5280/web/jwchat/index.html

in the browser. You should be able to see the login window. Bingo you are done.

Since I liked to explore more. I had a look at the ejabberdctl command. So thought of creating users using command line.

ejabberdctl register foo localhost 123

ejabberdctl register bar localhost 123

Read man page of ejabberdctl to understand the above command and args.

Now try to login using foo and bar in two new windows of the browser. And try to add them as contacts. Enjoy chatting :)

Trichur visit

I hardly celebrate any of the festivals. This time I was in Kerala (Palakkad, my native) from 15-18 of April. 3 days I dealt with mental stress. But its ok, no one is responsible for that. Its all fate :) The fourth day, i.e 18th april was the awesomest day I had. I along with my good friend Maxin decided to go to Trichur, to meet my classmate who got recently married. We weren’t able to attend his marriage. We reached Trichur by 9.45 AM. And then had breakfast from, the famous *BHARATH* hotel. I always love Trichur more than my hometown. I don’t know what is the attractive force behind it (ahm :) ). After breakfast Maxin and me started thinking about the gift we should buy for our friend Neelesh, so that he would remember us. As it was sunday most of the shops were closed. I felt sad and there was hardly a chance for any other shop to be opened at my friend’s place.

We moved towards Neelesh’s place. Aah!!! There was an super market store. We got into the shop. I said a big “NO”. There was nothing interesting in the shop which could be gifted to him. We were least interested in giving up. Thought for a while, and made a decision to buy all the health drinks available in the shop. That means, Horlicks, Boost, Women Horlicks etc. We were in a hurry of buying everything we saw. Which included something for pregnant lady too :P We also brought a bottle of wine. After grabbing whatever we can, we moved to Neelesh’s house. He was surprised to see me and Maxin with the gift that we brought for him.

After seeing the gift, Maxin told Neelesh, “Please finish all these before it expires :P ”. Even Ami(Amrutha) was shocked to see all the things we brought. Neelesh invited us for lunch. It was just when we started to eat, Neelesh told that Ami is the cook for the day. And she did by reading a recipe book. Me and Maxin started looking each other. We knew we have to go office tomorrow, hence we need to leave today. Since the food was good enough I am able to write the blog post :P

After a good lunch. We moved to IC software. The place where I and Maxin got inroduced about GNU/Linux. Pramode sir was happy to see us and vice versa. We had lots of fun and talked a lot. Later chechi joined us. The most interesting part was I was able to see the joy and happiness on their face, which made me and Maxin talk more and more :) The discussion went from technical to all sorts of jokes. We also talked about books. All together me and Maxin enjoyed the moments.

We left Pramode sir’s house by 7.40 PM. I had to catch the bus which will reach palakkad by 11.30 PM. Since Trichur town was almost ready to celebrate pooram, we had to wait longer to get a bus which will go to Trichur round. After getting down near Ragam theater we walked to Shakthan bus stand. The time was almost 8.30 PM. We found no bus to palakkad. Baah. Maxin told, “Lets move to KSRTC bus stand”. I nodded. When we reached KSRTC bus stand, I asked in the inquiry, “Sir, at what time will I get the bus to palakkad?”. He replied, “One bus is right there( which was full) and the other one was at 9.10 PM.” Ahm we have time for dinner. We went to a hotel and had our dinner. I always love the hotels in Trichur. The food in Trichur is awesome than in palakkad. Its my openion :)

After dinner, we came to the bus stand and decided, if the next bus comes and we won’t make it, we will make our journey little more adventurous. And it happened. We couldn’t make the journey in the bus and decided to hire a taxi. We reached palakkad by 10.40 PM. Maxin moved to Coimbatore and I moved to Bangalore from there.

Excluding the return to palakkad, it was all fun.

Saddest day

I will not forget this day (22-Feb-2010). I saw a man who was working in the noon. I saw the same man dead in the evening :( A poor guy from North India ( don’t know the exact place) who came to Bangalore for the sake of job. He was helping his master to demolish a building. All of a sudden the beam of the building fell over him and he died. I shed tears for him. Because I know that the government is not going to help his wife neither his new born baby :( ( I am not here for a flame war ). Its just a feeling that I am sharing nothing more I can do, I can only watch and cry for him. I wish some NGO’s come and help his family. Again I can only wish :(

Oats payasam(aka oats kheer)

I would like to share the Oats payasam recipe which I made for the dinner, with you all. After boiling milk, I added oats and sugar, and stirred. I was happily listening to Ilayaraja songs and stirring the combination. Grr. I saw the milk+oats+sugar combination turning into a payasam, may be because I added more oats. Which looked exactly like the payasam, my mom brings from the temple. Got an idea. Added cashew nut and dry grapes to the existing combination. Woow. Now it really looks awesome and tastes yummy. My roomie was laughing at me. He must have thought, “Poor chap, thought of preparing something and ended up with something else :P ”.

Unfortunately I couldn’t take the snap of my recipe. May be I will take next time. But this is how sometimes things workout. Some ideas come into mind. We deliver those ideas into code (milk+sugar+oats :) ). And then sometimes we feel that user may like to see it in a different way and  give some spicy looks( cashew + dry grapes ) for enhancement. I know its a bad analogy. I couldn’t think worser than this :)

FOSSMEET@NITC/2010

Day 1

After a long release schedule at office, I decided to move on to FOSSMEET@NITC on thursday night. I reached the NIT campus on friday morning. After the breakfast I had a long sleep in the guest room. By noon, I reached their Computer Center and tried to get an internet access. I started to make my slide. I finished it by 4.30 pm. By 5.30 pm, everyone gathered for the inaugural function of FOSSMEET.

After the inaugural function it was Sasikurmar sir gave a talk about Free Software.

Day 2

I woke up with a sad news. My friend Pradeepto missed the flight to Mumbai from Kolkata and he couldn’t make to FOSSMEET@NITC. Hence I decided to conduct a BoF on KDE for students who came there. But the result was disappointing. No one came for the BoF. The day started with Jain’s scribus talk.

I decided to spent time with my friends Praveen, Jain Basil, Vivek(and others). We also celebrated Praveen’s birthday.

Vivek actually took me outside for an awesome dinner.

Day 3

Day 3 started with my talk on how to build KDE for development. Unfortunately there were not more than 3 or 4 people who knew about KDE. I was little tensed because Atul was sitting in the hall listening the talk. After my talk Atul came to deliver his talk. This was second time I was listening to Atul’s talk. It was nice to hear how he was interested in technology and lot more things. I wish students would really think about engineering seriously :)

After Atul’s talk I along with Unni decided to conduct a Qt workshop. I thought of giving an introductory way to create small widgets, signals and slots and things like that in C++. But again the students who were there for my Qt workshop hardly knew C++.

Well altogether I found people really liked the workshop rather than talk. And hence next time I will try to submit a workshop rather than talk.

←Older