RWE: Ejabberd failed to start in Debian Wheezy

I had an old laptop that I decided would make a good toy for playing around with some lightweight server applications. It was a great candidate for several reasons. For one, I’m not using it for something else. Second, it was free. Third, it has a built in battery backup. Seemed like a win-win for me.

I’ve mentioned before that I am a member of SDF, the Super Dimensional Fortress (sdf.org), a free to the community Unix server that allows remote log in and numerous other goodies. Among those extras is the free jabber (XMPP) service for members. It’s really great, especially for free, but on several occaisions, it has been down for maintenance when I was waiting to receive a message to someone. That is a bit annoying. Obviously, server maintenance needs to happen, and I am really thankful to sdf.org for providing the service. I was just thinking that this would be a good excuse to try setting up my very own XMPP server.

Thus enter ejabberd. Ejabberd is an open source XMPP server that is available on most GNU/Linux distributions, including Debian Wheezy, which was already on my laptop. I looked up several tutorials on-line, and they all seemed to indicate that it would be super easy to set up, and I could get it up and running in a few minutes.

Screenshot_20171030-085330.png

Two days latter…..

I finally got it set up and running. No matter which tutorial I followed, none of them worked. It took hours of research (in between being a dad, husband, working person, etc.), but I finally figured out the problem. Not too many people are planning to set up their own XMPP server, and this problem is probably specific to Debian Wheezy, but I figured that I would show you the REAL steps to get this going.

The problem was that after installing ejabberd, even with the default settings, it would say:

starting service: ejabbered………………………………………………………..FAILED.

And there was no rhyme or reason why! I was only able to figure it out by running ejabberd live, so the output came to the terminal, and then I could see the issue.

# apt-get install ejabberd

If you are like me, it will fail after install.

# dpkg-reconfigure ejabberd

Set up your server name, admin, etc.

# ps axc|grep beam

# ps axc|grep epmd

Now kill both of those processes.

# nano /etc/default/ejabberd

Uncomment the ERLANG_NODE=ejabberd line, or add it if it does not exist. Save and exit that file. Not having this line caused my first failure.

Edit your  /etc/hosts file to look like this:
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Essentially, you need to delete any “extra” hosts in the file, just leave the localhost ones. Later, more can be added to the file once ejabberd is running, but for some reason, having extra hosts in this file cause my second failure.

Now you can start ejabberd. I recommend that the first time, you start it “live” so you can see what is happening under the hood:

# /etc/init.d/ejabberd live

But in the future, you can just start it with the usual services tags:

# service ejabberd restart

You should now have a running instance of ejabberd! Of course, now you need to add a user, if you didn’t already. Here is an example:

# ejabberdctl register userName xmppServerAddress.net superSecretPassword

And there we go! At least for me, that was enough to set up a fully functional XMPP server with ejabberd on Debian Wheezy. Of course, this still needs tuning and enabling features like blocking, encryption, etc., but hey, at least now you have something to work with!

Linux – keep it simple.

Geany: the little IDE that could!

geany_ide.png

Recently, while working with some older equipment, I needed a lightweight java IDE to compile some java projects. I really wasn’t looking for something quite as big as eclipse or netbeans, I just wanted a simple, one stop solution that would allow me to build java programs on an older laptop.

So, I rubbed a magic lamp, and out popped Geany!

Well, more specifically, the laptop is running Debian Wheezy, and had openJDK already installed. With that alone, I could have built java programs from the command line, but it can get a little tedious. So, I looked on the repositories for an IDE that wasn’t too large.

Thus enter Geany. I first used Geany a long time ago as a text editor on #! (CrunchBang) Linux, but revisiting the program revealed that I was not using it to it’s full potential. Specifically, you can compile, build, and run various program types from within Geany. Of course, it only outsources the commands for you, so you need a java jdk in order to compile java, or a c++ compiler to compile c++. Geany just does all the command line work for you.

What Geany does accomplish for you, however, is a great user interface with templates and the ability to organize projects or view code with different filters. As you can see in the picture, I was testing out Logic Crazy’s Alpha Beta Chess program.

As well as showing you the code, it can do parenthesis highlighting, colors for different code type, and a class and method tree on the side. It really is a great program if you need a lightweight IDE. I know that I’ll be putting it to good use.

Linux – keep it simple.