Building mod_webpresence for ejabberd on CentOS

I keep forgetting how to setup the mod_webpresence for ejabberd whenever I happen to reinstall everything so I am typing it out here for future reference and maybe it’ll even be useful for others. The instructions aren’t 100% clear for me on the ejabberd-contrib github page since I have always had issues figuring it out. Hopefully these instructions will save some time in the future.

First I have to remove the existing erlang-kernel and all it’s packages and update to a new version of Erlang. I actually don’t know if this is necessary anymore but I update Erlang to the latest version since it was necessary in the past in order to properly be able to build the module.

Then I download latest Erlang package and install it instead. They have a bunch of operating systems including Ubuntu, CentOS, Fedora, Debian, Mac OS X and Windows.

From the ejabberd-contrib repository I upload to my ejabberd/lib folder the ejabberd-dev module and the mod_webpresence module. You can do this numerous ways. I simply download or clone the git repository and upload or move those module’s folders to the ejabberd/lib folder.

Then I go into the mod_webpresence folder, make the build.sh executable and run it.

The output shouldn’t have any errors or unfortunately something else is wrong. It should create a beam file in the ebin folder and say something like: Recompile: src/mod_webpresence

Next I copy the ejabberd/lib/mod_webpresence/ebin/mod_webpresence.beam file to ejabberd/lib/ejabberd-14.07/ebin/mod_webpresence.beam

Edit the ejabberd/conf/ejabberd.yml file and add the parts to the appropriate sections as shown below.

This part goes under the port: 5280 listen section or whatever port you are running the ejabberd_http module on that you want to serve the mod_webpresence from.

For example mine looks like this:

And this part goes down where all the other modules are defined. Make sure you update the /PATH/TO/ejabberd

Restart ejabberd and that should hopefully work out. If the ejabberd server doesn’t start then you probably should check the logs and see if you can see what’s wrong. If something is wrong then that really sucks! Especially if you don’t know much about Erlang. You will probably have to do some digging and try to figure it out.

If the server started fine and there are no errors in the logs then now you have to use a jabber client (I used Miranda NG) and login as the user you want to see the presence of. Access the Service Discovery under your jabber connection Services and Register with the webpresence service.

Once you do that it should send you a message telling you some examples and so forth like this:

If all is well then you should now be able to find or write your own app to detect and display your online presence. I ended up using the xml URL like this: jabber.example.com:5280/presence/jid/username/jabber.example.com/xml

Servers, Code, Websites, the Whole Internet

So many websites out there. They number in the billions. So many people trying to make their mark in the world wide web. Why start another website? Well I’m hoping to write about things I find useful, especially if I might want to reference it in the future, and especially if I’ve already had to go searching more than once for the information. If I just put it on this site then I won’t have to go searching all the time. Hopefully other people will also find this information useful.

Lately I’ve been doing a lot of coding, and a lot of gaming. Some day I’d like to code a game. But for now I’ll just stick to playing games and coding other things. The closest thing to coding a game I’ve done probably would be plugins for Minecraft. I’ve programmed several Minecraft/Bukkit plugins in the past but due to Minecraft being bought by Microsoft and all the turmoil surrounding all that I’m going to have to wait awhile to update those. I used to run a small Minecraft server which had a really nice little community but now I just have a small, whitelisted vanilla server running. But that isn’t really coding a game exactly, merely plugins for a game.

Although another thing I did when I first started programming many years ago when I was playing around in QuickBASIC was making somewhat of a clone of a game we had as kids called Alien Invaders Plus which I code named Happy Al. I don’t know what ever happened to that but it was a pretty good learning experience at the time. I kind of wish I still had it.

That was how we were taught back then, starting with Watcom BASIC and then eventually QBasic and then to Visual BASIC. After that I found QuickBASIC and played around with it for awhile. Even tried some C at one point and probably some others. I had even successfully dabbled in machine code with WinDasm32 at one point. Then I kind of moved into the field of web development which I’m now self-employed in (though I kind of suck at making graphics). I’ve been starting to work on some Android apps now as well. The new Android 5.0 Lollipop is coming out tomorrow so that is something to look at.

Maybe if things go well I can make some Android apps or maybe even some Android games. But I have a feeling that will be a ways off yet.