koldfront

Installing Converse with Apache and ejabberd #xmpp

๐Ÿ•—๏ธŽ - 2019-06-02
Converse logo I banged my head against this for a while, so here is the short summary on how to get Converse going on a (Debian) server running Apache and ejabberd.

ejabberd is configured to have ejabberd_http_ws on "/websocket" on port 5280. This was already so in my setup.

I downloaded converse.min.css and converse.min.js from cdn.conversejs.org and put them in a folder called xmpp on my webserver. I also had to download a bunch of fonts: baumans.ttf, muli.ttf, fa-solid-900.{woff2,woff,ttf} and fa-regular-400.{woff2,woff,ttf}, which I put in xmpp/webfonts/.

Then I created xmpp/index.html, which simply contains:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Converse - koldfront</title>
    <link rel="stylesheet" type="text/css" media="screen" href="converse.min.css">
    <script src="converse.min.js" charset="utf-8"></script>
  </head>
  <body>
    <script>
      converse.initialize({
          websocket_url: 'wss://koldfront.dk/websocket/',
          view_mode: 'fullscreen'
      });
    </script>
  </body>
</html>

Now, in Apache we need to include the proxy_wstunnel module, so run sudo a2enmod proxy_wstunnel. And in the configuration for the webserver, we need to tell it to proxy the /websocket URL to ejabberd:

    SSLProxyEngine on
    ProxyPass "/websocket/" "wss://koldfront.dk:5280/websocket/"
    ProxyPassReverse "/websocket/" "wss://koldfront.dk:5280/websocket/"

And then I was able to login.

I haven't figured out why image uploads don't work (they do from Conversations (Android) and jabber.el (Emacs)), but otherwise Converse seems to work.

Add comment

To avoid spam many websites make you fill out a CAPTCHA, or log in via an account at a corporation such as Twitter, Facebook, Google or even Microsoft GitHub.

I have chosen to use a more old school method of spam prevention.

To post a comment here, you need to:

ยน Such as Thunderbird, Pan, slrn, tin or Gnus (part of Emacs).

Or, you can fill in this form:

+=