JWChat for Elgg

Shortinfo
Licence: GNU General Public License
Version: 0.1 Beta
Requires: PHP 5, ejabberd 2, MySQL, Elgg 1.2
Description: Integrates JWChat in an Elgg installation and provides Instant Messaging via Jabber.

JWChat in Elgg
JWChat in Elgg Zoom

» View Demo

General

Thats an interessting point for several elgg users: Jabber integration for Elgg! As frontend I used a modified version of the web based JWChat. The backend communicates with the jabber server at database level and takes care about correct registrations and buddy lists.

Please Note

  • Currently there is only ejabberd 2 and MySQL support.
  • The browser support of JWChat should be simmilar with the browser support of this plugin.
  • This plugin needs access to the database used by the jabberserver.
  • Multi user chats (muc) are possible. However, the admins have to be hardcorded in the config file of ejabberd.

Installation

  • Set up ejabberd with MySQL native driver as described here. Adjust the additional modules mod_last, mod_offline, mod_roster and mod_vcard as well (as described at the end). Note: Here you can download debian packages for erlang mysql support.
  • Make sure that either HTTP-Polling or HTTP-Binding is activated in the ejabberd config. For help please consult Google or the ejabberd doc.
  • Configure your webserver. How to do that is described in the README of JWChat (quote):
    • Setup your web server so that it redirects some local address like http://jabber.example.com/http-poll/ to some service that either implements HTTP Polling or HTTP Binding.

      Here is an example that should work with a default ejabberd installation on the same host:


      <VirtualHost *>
      ServerName jabber.example.com
      # (...)
      AddDefaultCharset UTF-8
      RewriteEngine on
      RewriteRule http-poll/ http://127.0.0.1:5280/http-poll/ [P]
      </VirtualHost>

      (...)

      Note 1: You need to enable mod_rewrite and mod_proxy at your apache configuration. Apache2 users also need to enable the protocol specific proxy module mod_proxy_http.

      Note 2: With JabberHTTPBind you don't need to do this sort of address rewriting if you're serving JWChat's files from within your servlet container directly or you're using some technique like mod_jk to mount a remote servlet engine directory transparently into your apache's domain of served addresses.

    • Restart your web server.

    • Test if this redirect works. Following the example above point your browser to http://jabber.example.com/http-poll/. You should see the same response as if you you're pointing it to http://jabber.example.com:5280/http-poll/.

    However, this didn't work for me. I rather needed to use the following lines.


    <VirtualHost *>
    ProxyPass /http-bind/ http://127.0.0.1:5280/http-bind/
    ProxyPassReverse /http-bind/ http://127.0.0.1:5280/http-bind/
    # further more stuff..
    (...)
    </VirtualHost>

    Replace 127.0.0.1 with the server address of youre ejabberd.

  • Now the plugin comes into play. Download and extract it, copy the jabber folder into the mod folder of the elgg installation and activate the plugin in the admin interface of elgg.
  • Configure the plug in in the elgg admin interface. Look at the screenshot above to get my test configuration. Note: In most instances you cannot run the jabberserver as localhost, because your user won't be able to connect to it.
  • The connection data to the database used by the jabberserver are not configured by admin interface (because of security issues). Instead you have to edit the file mod/jabber/config.db.php.
  • If all seems fine you should remove the module mod_register from the ejabberd configuration file. After that only the plugin is able to change passwords or registrate users.
  • Thats it! Surely its a bit nasty to come to this point, but at the end all efforts pay off :)

Download