Difference between revisions of "Prosody"

From Jon's Wiki
(Created page with "'''Prosody''' is a small and fast XMPP daemon written in Lua. You can install it like this: sudo apt-get install prosody Then edit the config <tt>/etc/prosody/prosody.cfg.l...")
 
Line 3: Line 3:
 
  sudo apt-get install prosody
 
  sudo apt-get install prosody
  
Then edit the config <tt>/etc/prosody/prosody.cfg.lua</tt> to make sure you have BOSH support, group rosters and compression enabled, and you probably want self-registration off:
+
Edit the config <tt>/etc/prosody/prosody.cfg.lua</tt> to make sure you have BOSH support, group rosters and compression enabled, and you probably want self-registration off:
  
 
  modules_enabled = {
 
  modules_enabled = {
Line 16: Line 16:
  
 
  ...
 
  ...
 +
 +
Set up a virtual host config for your domain in <tt>/etc/prosody/conf.avail/yourdomain.cfg.lua</tt>
 +
 +
VirtualHost "yourdomain.com"
 +
    enabled = true
 +
    ssl = {
 +
        key = "/etc/ssl/private/star.yourdomain.com.key";
 +
        certificate = "/etc/ssl/certs/star.yourdomain.com.crt";
 +
    }
 +
 +
-- optional, for IRC-style chatrooms
 +
Component "chatrooms.yourdomain.com" "muc"
 +
    restrict_room_creation = "local"
 +
 +
-- optional, for file transfers
 +
Component "chatproxy.yourdomain.com" "proxy65"
 +
 +
Then enable it with ln -s into <tt>/etc/prosody/conf.d</tt>
 +
 +
=== DNS configuration ===
 +
 +
You need your chat, chatrooms, and chatproxy subdomains to be A records (not CNAME), and you also need 2 SRV records and a TXT record, thus:
 +
 +
_xmpp-client._tcp.yourdomain.com    = SRV: 0 5 5222 chat.yourdomain.com
 +
_xmpp-server._tcp.yourdomain.com    = SRV: 0 5 5269 chat.yourdomain.com
 +
 +
TXT: _xmpp-client-xbosh=https://chat.yourdomain.com/http-bind/
 +
 +
=== Add some users ===
 +
 +
Add yourself with
 +
 +
  sudo prosodyctl adduser yourusername@yourdomain.com
 +
 +
=== Links ===
 +
 +
More docs at
 +
 +
* http://prosody.im/doc/configure
 +
* http://prosody.im/doc/dns#srv_records

Revision as of 22:18, 20 March 2014

Prosody is a small and fast XMPP daemon written in Lua. You can install it like this:

sudo apt-get install prosody

Edit the config /etc/prosody/prosody.cfg.lua to make sure you have BOSH support, group rosters and compression enabled, and you probably want self-registration off:

modules_enabled = {
  "compression";
  "bosh";
  "groups";
  ...
}

allow_registration = false;
bosh_ports = { 5280 };
...

Set up a virtual host config for your domain in /etc/prosody/conf.avail/yourdomain.cfg.lua

VirtualHost "yourdomain.com"
    enabled = true
    ssl = {
        key = "/etc/ssl/private/star.yourdomain.com.key";
        certificate = "/etc/ssl/certs/star.yourdomain.com.crt";
    }

-- optional, for IRC-style chatrooms
Component "chatrooms.yourdomain.com" "muc"
    restrict_room_creation = "local"

-- optional, for file transfers
Component "chatproxy.yourdomain.com" "proxy65"

Then enable it with ln -s into /etc/prosody/conf.d

DNS configuration

You need your chat, chatrooms, and chatproxy subdomains to be A records (not CNAME), and you also need 2 SRV records and a TXT record, thus:

_xmpp-client._tcp.yourdomain.com    = SRV: 0 5 5222 chat.yourdomain.com 
_xmpp-server._tcp.yourdomain.com    = SRV: 0 5 5269 chat.yourdomain.com

TXT: _xmpp-client-xbosh=https://chat.yourdomain.com/http-bind/

Add some users

Add yourself with

  sudo prosodyctl adduser yourusername@yourdomain.com

Links

More docs at