Rolling Your Own IM Server
Ars has a pretty good primer on getting your own XMPP IM server going. That said, I’d throw in a few comments about ejabberd. In the one install I saw of that, it was a mess. We were using it with a LDAP backend (synced with AD), and we had a myriad of issues: High CPU utilization, seemingly random issues with shared roster groups (buddy lists), frequent crashes, et cetera. This was with ejabberd 2.0.5, so maybe things are better now. And I know lots of large sites (larger than the one I managed) run it without issue, but it was incredibly problematic for us. And then there was Erlang, which I thought was terribly bizarre, and certainly obscure.
We’re running Openfire right now, and it’s been rock solid. It’s not a terribly small environment either, with several hundred users, heavy MUC utilization, and so on. There’s a LDAP backend once again, and a MySQL DB as well. And though I’m not a huge Java fan, it is easy to work with (and everyone and their mother knows it well).
Unless you’re doing a deployment with well over 1,000 users, I see no reason to even consider ejabberd. The one knock I have on Openfire (and it’s really not even specific to Openfire) is that importing keys and certs into Java’s keystore is such a pain in the ass, compared to any other method of doing it.