Jabber - JWchat

in

There are two methods of using JWChat with eJabberd: using apache or local server. Both work, but I prefer more secure and robust apache.

JWchat can access eJabberd either via http-poll or http-bind. Note that Firefox 3.0.6+ breaks http polling in JWchat. Thus, we will use http bind method.

Configure eJabberd for http binding in /etc/ejabberd/ejabberd.cfg:

  1. {listen, [
  2.    ...
  3.      {5280, ejabberd_http, [ http_bind, http_poll, web_admin ]}
  4.  ]}.

Also, explicitly enable http binding and polling modules in /etc/ejabberd/ejabberd.cfg (this step is missing from the official guide):

  1. {modules, [
  2.   ...
  3.     {mod_http_bind, []}
  4.    ,{mod_http_poll, []}
  5. ]}.

Note: as of ejabberd 2.1.6 the "mod_http_poll" line make the daemon crash. Do not use it, the poll module will run without this line.

Set up virtual apache host in /etc/httpd/vhosts/jabber.conf

  1. ServerName jabber.ourdom.com:443
  2. DocumentRoot /var/www/jabber
  3. Include vhosts/ssl.inc
  4. AddDefaultCharset UTF-8
  5.  
  6. <Directory /var/www/jabber>
  7. Options +MultiViews
  8. </Directory>
  9.  
  10. ReqwriteEngine On
  11. RewriteRule  ^/$  /jwchat/  [R,L]
  12.  
  13. ProxyRequests Off
  14. ProxyPass         /http-bind/  http://localhost:5280/http-bind/  keepalive=on
  15. ProxyPass         /http-poll/  http://localhost:5280/http-poll/  keepalive=on
  16. ProxyPass         /admin/      http://localhost:5280/admin/      keepalive=on
  17. ProxyPassReverse  /admin/      http://localhost:5280/admin/
  18.  
  19. <Location /admin>
  20. Include vhosts/authorize.inc
  21. </Location>

Restart Apache.

Download jwchat-1.0.tar.gz (мое зеркало) from JWChat site and extract into /var/www/jabber/jwchat.

Edit /var/www/jabber/jwchat/config.js. Set SITENAME to your domain. Comment out all backends but native binding. Set 'httpbase' to the redirected address from above (/http-bind/).

Also prevent disconnect due to inactivity timeout. Notice the Timeout value in the Apache configuration file /etc/httpd/conf/httpd.conf. In my case it is 120 seconds. It is the connection inactivity time after which Apache proxy closes the connection (on /http-bind/). Adjust JSJACHBC_MAX_WAIT at jsjac.js to a smaller value like 100 or such:

var JSJACHBC_MAX_WAIT = 100;
var JSJACHBC_MAXPAUSE = 90;

Point your browser to http://jabber.ourdom.com/jwchat and log in.

Attachments

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
To prevent automated spam submissions leave this field empty.