Prosody (http://prosody.im/ is a resource-friendly XMPP server written entirely in the lua language. While not being as featureful yet as some other players in the XMPP sphere such as OpenFire or ejabberd it conforms to the XMPP specs and covers most commonly used functionality, for example components, BOSH and personal eventing.
However for the new XMPP administrator it is extremely simple to implement.
Getting the software
The Prosody site has binary installers for several systems, for instance Debian Linux and Windows. Source is also available for other systems or those that want to tinker. You'll need lua's sockets, expat and security libraries (for TLS) to build and run it
ThatFlemingGent's RPM repositories for Red Hat Enterprise Linux and Fedora (over at http:///www.thatfleminggent.com/rpm-packages for those unfamiliar with them) will allow you to install them directly via "yum install prosody", including all dependencies
Basic preparation
Once that's installed, configuration is surprisingly easy
- Open the "/etc/prosody/prosody.lua.cfg" file in your favourite text editor
- The first uncommented stanzas cover global configuration (Host "*") - the defaults here are fairly sane. You may want to change your SSL key and enable the "posix" module for logging.
- There's a buglet in the package regarding the (non-setting) of a pidfile location. It's a good idea to create a "/var/run/prosody" directory - owned by the prosody user as it drops rights immediately - and point the following directive at it in your global config
pidfile = "/var/run/prosody/prosody.pid"
- If you want to log, add a "logfile" directive to the global section. eg
logfile "*syslog" -- logs to syslog,
logfile "prosody.log" -- log to a discrete "prosody" logfile
By default it logs to the console, which may not suit production environments.
My first virtual host
Simply this:
Host "dotprofileconsulting.com" -- your domain goes here.
enabled = true
admins = { "thatguy@dotprofileconsulting.com",
"bofh@dotprofileconsulting.com"}
...after the global settings. You can give it seperate SSL keys and other options per the global settings, these will override the global ones.
The network side
- Ensure TCP ports 5222 (xmpp client to server) and 5269 (xmpp server-to-server) are open on your firewall
- Ensure you have the correct SRV DNS records pointing to your server ie
_xmpp-client._tcp IN SRV 0 0 5222 myxmppserver.example.com
_xmpp-server._tcp IN SRV 0 0 5269 myxmppserver.example.com
Starting up the server and creating a user
- "service prosody start" (Red Hat and derivatives) will get you up and going. "/etc/init.d/prosody" or even "prosodyctl start" works for other OS'
The "prosodyctl" command does most of the heavy lifting. Creating a user is as simple as issuing the following
prosodyctl add [JID]
...where the JID is myuser@example.com - standard jabber ID format as you'd expect. Enter a good password and you're ready to point a client at it.
Enjoy!
Caveats and things to know
Prosody does not support connections over IPv6 yet (as far as I can determine, I'd love to see it!)
It doesn't enable legacy SSL over 5223 without passing the "legacy_ssl_ports" option (eg "legacy_ssl_ports = { 5223 }") in your vhost. This is only a problem for old clients, so it should be a rare inconvenience.
It uses it's own internal database store, kept under /var/lib/prosody - no support for relational databases / sqlite et. al. Remember to back this directory up regularly!